Skip to content

Wrong dependecy version of requests for Databricks provider #23917

Closed

Description

@yershovkiril

Apache Airflow Provider(s)

databricks

Versions of Apache Airflow Providers

apache-airflow-providers-databricks==2.7.0

Apache Airflow version

2.2.2

Operating System

Debian GNU/Linux 11 (bullseye)

Deployment

Other

Deployment details

No response

What happened

There was added import statement from the requests library to airflow/providers/databricks/hooks/databricks_base.py by this MR.

But minimal version of requests wasn't bumped up to >=2.27.0, as we can see it's still >=2.26.0, but that JSONDecodeError class added to requests library starting from 2.27.0 (see release notes).

It brings inconsistency between libraries and leads to following error:

  File "/usr/local/lib/python3.7/site-packages/airflow/providers/databricks/hooks/databricks.py", line 33, in <module>
    from airflow.providers.databricks.hooks.databricks_base import BaseDatabricksHook
  File "/usr/local/lib/python3.7/site-packages/airflow/providers/databricks/hooks/databricks_base.py", line 34, in <module>
    from requests.exceptions import JSONDecodeError
ImportError: cannot import name 'JSONDecodeError' from 'requests.exceptions' 

What you think should happen instead

it breaks DAGs

How to reproduce

Use any Databricks operator with requests==2.26.0, which is defined is minimal compatible version

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. boring-cyborg commented on May 25, 2022

    @boring-cyborg

    Thanks for opening your first issue here! Be sure to follow the issue template!

  2. collinmcnulty commented on May 25, 2022

    @collinmcnulty
    Contributor

    I have also reproduced this error and confirmed that adding requests>=2.27,<3 fixes the problem.

  3. vincentkoc commented on May 26, 2022

    @vincentkoc
    Contributor

    Started a PR for this based on the comment/test from @collinmcnulty as #23927

  4. added a commit that references this issue on May 27, 2022
  5. added a commit that references this issue on May 27, 2022
  6. potiuk commented on May 31, 2022

    @potiuk
    Member

    Closed by #23927 (@koconder please let us know if some more change is needed).

  7. added a commit that references this issue on Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions