Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CT-1469] [Bug] Define Python Version when Installing Dependencies #6203

Closed
2 tasks done
emmyoop opened this issue Nov 3, 2022 · 2 comments · Fixed by #6204, dbt-labs/dbt-snowflake#307 or dbt-labs/dbt-snowflake#317
Closed
2 tasks done
Assignees
Labels
bug Something isn't working

Comments

@emmyoop
Copy link
Member

emmyoop commented Nov 3, 2022

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

We don't currently define the version of python to use when installing dependencies so it just uses what's in the PATH of the runner. This recently updated to Python 3.11 which we don't officially support. This is causing some dependency installation failures.

Expected Behavior

Dependencies install without failure.

Steps To Reproduce

Run the main.yml action.

Relevant log output

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.11.0/x64/bin/dbt", line 33, in <module>
    sys.exit(load_entry_point('dbt-core==1.2.2', 'console_scripts', 'dbt')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0/x64/bin/dbt", line 25, in importlib_load_entry_point
    return next(matches).load()
           ^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/importlib/metadata/__init__.py", line 198, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/site-packages/dbt/main.py", line 2, in <module>
    from dbt.logger import log_cache_events, log_manager
  File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/site-packages/dbt/logger.py", line 16, in <module>
    from dbt.dataclass_schema import dbtClassMixin
  File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/site-packages/dbt/dataclass_schema.py", line 15, in <module>
    from mashumaro import DataClassDictMixin
  File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/site-packages/mashumaro/__init__.py", line 4, in <module>
    from mashumaro.serializer.json import DataClassJSONMixin
  File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/site-packages/mashumaro/serializer/json.py", line 28, in <module>
    class DataClassJSONMixin(DataClassDictMixin):
  File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/site-packages/mashumaro/serializer/base/dict.py", line 16, in __init_subclass__
    builder.add_from_dict()
  File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/site-packages/mashumaro/serializer/base/metaprogramming.py", line 270, in add_from_dict
    pre_deserialize = self.get_declared_hook(__PRE_DESERIALIZE__)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/site-packages/mashumaro/serializer/base/metaprogramming.py", line 255, in get_declared_hook
    if not is_dataclass_dict_mixin(cls):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/site-packages/mashumaro/meta/helpers.py", line 247, in is_dataclass_dict_mixin
    return type_name(t) == DataClassDictMixinPath
           ^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/site-packages/mashumaro/meta/helpers.py", line 93, in type_name
    elif is_generic(t) and not is_type_origin:
         ^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/site-packages/mashumaro/meta/helpers.py", line 161, in is_generic
    raise NotImplementedError
NotImplementedError
Error: Process completed with exit code 1.

Environment

- OS:
- Python:
- dbt:

Which database adapter are you using with dbt?

No response

Additional Context

No response

@emmyoop emmyoop added the bug Something isn't working label Nov 3, 2022
@github-actions github-actions bot changed the title [Bug] Define Python Version when Installing Dependencies [CT-1469] [Bug] Define Python Version when Installing Dependencies Nov 3, 2022
@emmyoop emmyoop self-assigned this Nov 3, 2022
@mzw4
Copy link

mzw4 commented Nov 17, 2022

This is still an issue for me when running the dbt cli command with Python 3.11 and dbt-core 1.3.1

$ dbt                                                                                                                                                                                       Py mesh-data 14:23:32
Traceback (most recent call last):
  File "/Users/mzw/opt/anaconda3/envs/mesh-data/bin/dbt", line 5, in <module>
    from dbt.main import main
  File "/Users/mzw/opt/anaconda3/envs/mesh-data/lib/python3.11/site-packages/dbt/main.py", line 3, in <module>
    from dbt.logger import log_cache_events, log_manager
  File "/Users/mzw/opt/anaconda3/envs/mesh-data/lib/python3.11/site-packages/dbt/logger.py", line 17, in <module>
    from dbt.dataclass_schema import dbtClassMixin
  File "/Users/mzw/opt/anaconda3/envs/mesh-data/lib/python3.11/site-packages/dbt/dataclass_schema.py", line 37, in <module>
    class dbtClassMixin(DataClassDictMixin, JsonSchemaMixin):
  File "/Users/mzw/opt/anaconda3/envs/mesh-data/lib/python3.11/site-packages/mashumaro/mixins/dict.py", line 16, in __init_subclass__
    builder.add_from_dict()
  File "/Users/mzw/opt/anaconda3/envs/mesh-data/lib/python3.11/site-packages/mashumaro/core/meta/builder.py", line 419, in add_from_dict
    dialects_feature = self.is_code_generation_option_enabled(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mzw/opt/anaconda3/envs/mesh-data/lib/python3.11/site-packages/mashumaro/core/meta/builder.py", line 594, in is_code_generation_option_enabled
    type_name(ancestor)
  File "/Users/mzw/opt/anaconda3/envs/mesh-data/lib/python3.11/site-packages/mashumaro/core/meta/helpers.py", line 150, in type_name
    elif is_generic(t) and not is_type_origin:
         ^^^^^^^^^^^^^
  File "/Users/mzw/opt/anaconda3/envs/mesh-data/lib/python3.11/site-packages/mashumaro/core/meta/helpers.py", line 217, in is_generic
    raise NotImplementedError
NotImplementedError

@jtcohen6
Copy link
Contributor

@mzw4 Python 3.11 is not yet officially supported within dbt-core. We're planning to add that support for v1.4: #6147

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment