Skip to content

Conversation

@justinpakzad
Copy link
Contributor

Made sqlalchemy an optional dependency for the Databricks provider. AirflowOptionalProviderFeatureException() gets raised if it's not installed. Just a quick note - Databricks uses the databricks-sqlalchemy package, since it's now an optional dependency, I needed to add it to the dev dependencies to ensure the tests that rely on it work properly.

closes: #59900


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@potiuk
Copy link
Member

potiuk commented Jan 5, 2026

I think, the compat tests are failing because of an interesting side-effect of making databricks-sqlalchemy optional. What happens is that we we are installing "dev" dependencies with airflow 3 -> so latest databrics-sqlalchemy is installed (2.0.8) - because it supports sqlalchemy 2 (and airflow 3.2 already supports it). Then when later airflow 2 or 3 versions are installed, they bring the sqlalchemy to 1 (because they do not support 2) but they do not bring databricks-sqlalchemy down, when databricks provider is installed then (without sqlalchemy extra) - it also will not bring the databricks-sqlalchemy down :(

@potiuk
Copy link
Member

potiuk commented Jan 5, 2026

I wil send a workaround patch shortly for that "optional sqlalchemy extra" soon

@justinpakzad
Copy link
Contributor Author

Thanks for chiming in. Will update the PR w the changes once you send the workaround patch over.

@potiuk
Copy link
Member

potiuk commented Jan 5, 2026

Fixup pushed

@justinpakzad
Copy link
Contributor Author

justinpakzad commented Jan 5, 2026

Fixup pushed

Thanks for that. I wasn't sure if I was meant to make the change myself, so I was waiting to update the "databricks-sqlalchemy>=1.0.2" dependency. Let me update that now.

@potiuk potiuk force-pushed the fix/databricks-sqlalchemy-optional-dep branch from ecd8139 to 7143f89 Compare January 5, 2026 23:36
@justinpakzad justinpakzad marked this pull request as ready for review January 5, 2026 23:49
@justinpakzad justinpakzad force-pushed the fix/databricks-sqlalchemy-optional-dep branch from 7143f89 to 00eb9cb Compare January 6, 2026 19:23
Copy link
Contributor

@jscheffl jscheffl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for me! Restarted CI - hopefully will turn green in a moment.

@jscheffl jscheffl merged commit 5ead8f7 into apache:main Jan 6, 2026
243 of 245 checks passed
chirodip98 pushed a commit to chirodip98/airflow-contrib that referenced this pull request Jan 9, 2026
…0110)

* Made sqlalchemy dependency optional for databricks provider

* fixup! Made sqlalchemy dependency optional for databricks provider

* rst file modified

* switched dep depency to use airflow-providers sqa

---------

Co-authored-by: Jarek Potiuk <[email protected]>
stegololz pushed a commit to stegololz/airflow that referenced this pull request Jan 9, 2026
…0110)

* Made sqlalchemy dependency optional for databricks provider

* fixup! Made sqlalchemy dependency optional for databricks provider

* rst file modified

* switched dep depency to use airflow-providers sqa

---------

Co-authored-by: Jarek Potiuk <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add proper dependencies for sqlalchemy - databricks

3 participants