Skip to content

Conversation

@hohshho
Copy link
Contributor

@hohshho hohshho commented Jan 2, 2026

Closes: #59898
Related: #59895

What does this PR do?

This PR makes sqlalchemy an optional dependency for the Impala provider.
The import in ImpalaHook is now wrapped in a try/except block, and it raises an AirflowOptionalProviderFeatureException if sqlalchemy is not installed when accessed.

Why is this needed?

This aligns the Impala provider with Airflow's standard for task isolation and core dependency removal. By making sqlalchemy optional, we ensure that the provider can run in lightweight environments where sqlalchemy is not strictly required, unless the user explicitly needs features that depend on it (e.g., get_uri or specific SQL connection helpers).


^ 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.

@boring-cyborg
Copy link

boring-cyborg bot commented Jan 2, 2026

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: [email protected]
    Slack: https://s.apache.org/airflow-slack

Copy link
Contributor

@Srabasti Srabasti left a comment

Choose a reason for hiding this comment

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

Line 73 should be referencing "sqlalchemy>=1.4.49" instead of "sqlalchemy>=1.4.0".
Happy New Year!

@hohshho
Copy link
Contributor Author

hohshho commented Jan 3, 2026

Updated the minimum SQLAlchemy version to 1.4.49 as suggested. Thanks!

@potiuk potiuk requested a review from Srabasti January 4, 2026 00:20
Copy link
Contributor

@Srabasti Srabasti left a comment

Choose a reason for hiding this comment

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

LGTM - Thanks for incorporating the changes @hohshho!

Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

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

Approve but there is one NIT to take a look.

@hohshho hohshho force-pushed the fix-impala-sqlalchemy-dep branch from 9c29697 to de578e5 Compare January 6, 2026 11:33
@potiuk
Copy link
Member

potiuk commented Jan 6, 2026

One more small nit - after @Prab-27 comment I realized that kerberos one could be fixed as well :)

@potiuk potiuk merged commit 1b29744 into apache:main Jan 6, 2026
99 checks passed
@boring-cyborg
Copy link

boring-cyborg bot commented Jan 6, 2026

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

chirodip98 pushed a commit to chirodip98/airflow-contrib that referenced this pull request Jan 9, 2026
)

* Make sqlalchemy an optional dependency for Impala provider

* Align minimum SQLAlchemy version with Airflow requirements

* Refactor ImpalaHook to inline sqlalchemy import logic and update dev dependencies

* Use optional dependencies in dev group to avoid version duplication

Co-authored-by: Jarek Potiuk <[email protected]>

---------

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

* Make sqlalchemy an optional dependency for Impala provider

* Align minimum SQLAlchemy version with Airflow requirements

* Refactor ImpalaHook to inline sqlalchemy import logic and update dev dependencies

* Use optional dependencies in dev group to avoid version duplication

Co-authored-by: Jarek Potiuk <[email protected]>

---------

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 - impala

4 participants