-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Make SQLAlchemy optional for Postgres provider #60236
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
Conversation
|
hi @potiuk |
providers/postgres/src/airflow/providers/postgres/hooks/postgres.py
Outdated
Show resolved
Hide resolved
|
Hi @justinpazkad @potiuk , I’m currently seeing a CI failure from a pre-commit hook related to imports in postgres.py. |
|
You need to install |
| "apache-airflow-providers-openlineage", | ||
| # Additional devel dependencies (do not remove this line and add extra development dependencies) | ||
| "apache-airflow-providers-common-sql[pandas]", | ||
| "apache-airflow-providers-common-sql[polars]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to add dependency here : related discussion : here
| # Additional devel dependencies (do not remove this line and add extra development dependencies) | ||
| "apache-airflow-providers-common-sql[pandas]", | ||
| "apache-airflow-providers-common-sql[polars]", | ||
| "psycopg[binary]>=3.2.9", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR makes SQLAlchemy an optional dependency for the Postgres provider, following the same pattern already applied to other providers (for example Presto and Exasol).
Summary of changes
AirflowOptionalProviderFeatureExceptionwhen SQLAlchemy-dependent functionality is used without SQLAlchemy installedThis aligns the Postgres provider with the guidance described in the parent issue.
Note
Apologies for any confusion earlier — I had to delete the previous PR due to some local issues and have opened this new PR with the corrected and final changes.
References