dbt-labs / dbt-core

dbt enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications.
https://getdbt.com
Apache License 2.0
9.86k stars 1.63k forks source link

[CT-1520] [Bug] dbt-postgres:1.3.1 image throws on startup #6275

Closed torkjel closed 1 year ago

torkjel commented 1 year ago

Is this a new bug in dbt-core?

Current Behavior

The latest 1.3.latest image thows the following exception immediately upon startup:

> docker run -it ghcr.io/dbt-labs/dbt-postgres@sha256:e224ca10626e484a0d5dea072f13a910e0d8b34ee4959fb4a7db76892c852ee1
Traceback (most recent call last):
  File "/usr/local/bin/dbt", line 5, in <module>
    from dbt.main import main
  File "/usr/local/lib/python3.11/site-packages/dbt/main.py", line 3, in <module>
    from dbt.logger import log_cache_events, log_manager
  File "/usr/local/lib/python3.11/site-packages/dbt/logger.py", line 17, in <module>
    from dbt.dataclass_schema import dbtClassMixin
  File "/usr/local/lib/python3.11/site-packages/dbt/dataclass_schema.py", line 37, in <module>
    class dbtClassMixin(DataClassDictMixin, JsonSchemaMixin):
  File "/usr/local/lib/python3.11/site-packages/mashumaro/mixins/dict.py", line 16, in __init_subclass__
    builder.add_from_dict()
  File "/usr/local/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 "/usr/local/lib/python3.11/site-packages/mashumaro/core/meta/builder.py", line 594, in is_code_generation_option_enabled
    type_name(ancestor)
  File "/usr/local/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 "/usr/local/lib/python3.11/site-packages/mashumaro/core/meta/helpers.py", line 217, in is_generic
    raise NotImplementedError
NotImplementedError

Previous version prints the usage message as expected:

docker run -it ghcr.io/dbt-labs/dbt-postgres@sha256:58a78ffd8e0f59f620b8cc9ea66904fa46e09059b2ee93167775fab345e9387f
usage: dbt [-h] [--version] [-r RECORD_TIMING_INFO] [-d] [--log-format {text,json,default}] [...]

Expected Behavior

Not crash and burn :)

Steps To Reproduce

1: Run commands as shown above.

Relevant log output

No response

Environment

- OS: Docker on Ubuntu on WSL, and on Google Kubernetes Engine. 
- Python: 3.11 (in provided image)
- dbt: 1.3.0 (in provided image)

Which database adapter are you using with dbt?

postgres

Additional Context

This upgraded to Python 3.11 in the image: https://github.com/dbt-labs/dbt-core/pull/6180/files This report with a similar exception, claims mashumaro does not support Python 3.10 (and I presume it might have problems with 3.11 too then): https://github.com/dbt-labs/dbt-core/issues/5976

jtcohen6 commented 1 year ago

@torkjel Thanks for opening! Good call - I think we probably ought to revert https://github.com/dbt-labs/dbt-core/pull/6180 until dbt officially supports Python 3.11 (https://github.com/dbt-labs/dbt-core/issues/6147), and rebuild the Docker images for the affected versions in the meantime.