You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Postgres connection URI incompatible with SQLAlchemy >= 1.4.0b1 #15349
This affects all Airflow jobs that:
(A) Use SQLAlchemy version >= 1.4.0
(B) Obtain/use a Postgres URI from the get_uri method of a PostgresHook (method defined in the DbApiHook - airflow/hooks/dbapi.py).
This is because the PostgresHook (airflow/providers/postgres/hooks/postgres.py) class, defines a class attribute conn_type = 'postgres' instead of postgresql.
Right now my airflow jobs with the updated SQLAlchemy that are using SQLAlchemy create_engine with a postgres db are broken.
What you expected to happen:
That Airflow jobs using SQLAlchemy >= 1.4.0 and SQLAlchemy's create_engine with Postgres databases work correctly, and that get_uri generates a postgres URI starting with postgresql://.
Of course I could use an older SQLAlchemy version or manipulated the returned URI, but I guess it'd be nice if Airflow adapts to the updated prefix.
I saw #14811 before opening this but I thought it might be worth it to open a separate issue as it's a bit different, even if they are both caused by SQLAlchemy 1.4.
#14811 was fixed by pinning SQLAlchemy in Airflow requirements, but #14812 doesn't help here.
This is impacting jobs that are not sharing Airflow dependencies, e.g. custom docker images ran with the Kubernetes Pod Operator or Docker Operator, but which are relying on Airflow-generated URIs for connecting to postgresql.
Activity
boring-cyborg commentedon Apr 13, 2021
Thanks for opening your first issue here! Be sure to follow the issue template!
uranusjr commentedon Apr 13, 2021
Duplicate to #14811.
Giuzzilla commentedon Apr 13, 2021
I saw #14811 before opening this but I thought it might be worth it to open a separate issue as it's a bit different, even if they are both caused by SQLAlchemy 1.4.
#14811 was fixed by pinning SQLAlchemy in Airflow requirements, but #14812 doesn't help here.
This is impacting jobs that are not sharing Airflow dependencies, e.g. custom docker images ran with the Kubernetes Pod Operator or Docker Operator, but which are relying on Airflow-generated URIs for connecting to postgresql.
eladkal commentedon Feb 6, 2022
I think this issue is solved by #21205
@potiuk can you confirm?
potiuk commentedon Feb 7, 2022
Yep. confirmed (and it's being voted now) . Thanks for pointing it out. Closed by #21205 indeed.