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

typing_extensions 4.6.0 causes pydantic issues #785

Closed
Stklingner opened this issue May 23, 2023 · 8 comments
Closed

typing_extensions 4.6.0 causes pydantic issues #785

Stklingner opened this issue May 23, 2023 · 8 comments

Comments

@Stklingner
Copy link

Stklingner commented May 23, 2023

Expected Behavior

N/A

Current Behavior

Non-zero exit code on initialisation

Steps to Reproduce (for bugs)

Attempt to deploy while using typing_extensions > 4.5.0

Context

Automated build to existing workflow environment

Your Environment

Github Actions: Ubuntu 22.04
Python 3.9.5

  • dbx version used: 0.18.14
  • Databricks Runtime version: 2.1

Error log

Run export DATABRICKS_JOBS_API_VERSION=2.1
  export DATABRICKS_JOBS_API_VERSION=2.1
  dbx deploy --deployment-file conf/******.yml --environment ***
  shell: /usr/bin/bash -e {0}
  env:
    DATABRICKS_HOST: ***
    DATABRICKS_TOKEN: ***
    AWS_DEFAULT_REGION: ***
    AWS_REGION: ***
    AWS_ACCESS_KEY_ID: ***
    AWS_SECRET_ACCESS_KEY: ***
    pythonLocation: /opt/hostedtoolcache/Python/3.9.5/x64
    PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.9.5/x64/lib/pkgconfig
    Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.5/x64
    Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.5/x64
    Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.5/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.5/x64/lib
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.9.5/x64/bin/dbx", line 5, in <module>
    from dbx.cli import entrypoint
  File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/dbx/cli.py", line 7, in <module>
    from dbx.commands.deploy import deploy
  File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/dbx/commands/deploy.py", line 8, in <module>
    from dbx.api.adjuster.adjuster import AdditionalLibrariesProvider, Adjuster
  File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/dbx/api/adjuster/adjuster.py", line 6, in <module>
    from dbx.api.adjuster.mixins.existing_cluster import ExistingClusterAdjuster
  File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/dbx/api/adjuster/mixins/existing_cluster.py", line 8, in <module>
    from dbx.models.workflow.v2dot0.workflow import Workflow as V2dot0Workflow
  File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/dbx/models/workflow/v2dot0/workflow.py", line 19, in <module>
    class Workflow(WorkflowBase, TaskMixin, AccessControlMixin):
  File "pydantic/main.py", line 197, in pydantic.main.ModelMetaclass.__new__
  File "pydantic/fields.py", line 506, in pydantic.fields.ModelField.infer
  File "pydantic/fields.py", line 436, in pydantic.fields.ModelField.__init__
  File "pydantic/fields.py", line 552, in pydantic.fields.ModelField.prepare
  File "pydantic/fields.py", line 668, in pydantic.fields.ModelField._type_analysis
  File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/typing.py", line 835, in __subclasscheck__
    return issubclass(cls, self.__origin__)
TypeError: issubclass() arg 1 must be a class
Error: Process completed with exit code 1.
@Stklingner
Copy link
Author

Probably not really a dbx issue so feel free to close at your discretion.

@Stklingner Stklingner changed the title typing-extensions 4.6.0 causes pydantic issues typing_extensions 4.6.0 causes pydantic issues May 23, 2023
@camilo-s
Copy link

I'm facing the same issue although I found issue #756 first.

@Stklingner
Copy link
Author

Setting typing_extensions==4.5.0 in our project requirements.txt was our quick fix for others who have urgent deployments; no side-effects noticed.

@camilo-s
Copy link

Thanks for the tip. In the meantime I also found an upstream issue.

@giovannipapini-agilelab

Setting typing_extensions==4.5.0 in our project requirements.txt was our quick fix for others who have urgent deployments; no side-effects noticed.

Same issue here, this solution works correctly also for us.

@sasi143
Copy link

sasi143 commented May 23, 2023

Setting typing_extensions==4.5.0 in our project requirements.txt was our quick fix for others who have urgent deployments; no side-effects noticed.

Big thanks man. Spending time from the morning on this.

@mikeweltevrede
Copy link

mikeweltevrede commented May 23, 2023

Setting typing_extensions==4.5.0 in our project requirements.txt was our quick fix for others who have urgent deployments; no side-effects noticed.

This helped for me as well. Seems to come from the rich library, which specifies typing-extensions>=3.10.0.0.

Collecting typing-extensions<5.0,>=4.0.0 (from rich==12.6.0->dbx==0.8.12)

The new typing-extensions release 4.6.0 of 13 hours ago then causes this issue. This is known: python/typing_extensions#179 but seems to be an issue in Pydantic: pydantic/pydantic#5821. Fix is on the way: pydantic/pydantic#5826.

@renardeinside
Copy link
Contributor

hi everyone on this thread,
first of all thanks a lot for reporting the issue.

I've explicitly fixed pydantic version to a compatible one in dbx 0.8.16.
Please check it with the latest version, and feel free to reopen the request if it pops up again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants