-
Notifications
You must be signed in to change notification settings - Fork 16.7k
Closed
Labels
area:providerskind:bugThis is a clearly a bugThis is a clearly a bugneeds-triagelabel for new issues that we didn't triage yetlabel for new issues that we didn't triage yetprovider:postgres
Description
Apache Airflow Provider(s)
postgres
Versions of Apache Airflow Providers
apache-airflow-providers-postgres==6.2.0
Apache Airflow version
2.11.0
Operating System
Debian
Deployment
Docker-Compose
Deployment details
FROM apache/airflow:2.11.0-python3.12
What happened
- Adding a new Posgtres-Connection via the UI and chosing "Postgres" as the Connection Type
- Retrieving the URI for this connection in a Task with:
uri =Connection.get_connection_from_secrets('Test-Postgres').get_uri()results in:'postgres://my_user:my_pw@my_host:5432/my_db' - Using the generated URI ends up in the following exception, because it starts with '
postgres://' and thus is not supported by SQLAlchemy 1.4+ - Exception:
File "", line 2, in create_engine
File "/home/airflow/.local/lib/python3.12/site-packages/sqlalchemy/util/deprecations.py", line 375, in warned
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/home/airflow/.local/lib/python3.12/site-packages/sqlalchemy/engine/create.py", line 518, in create_engine
entrypoint = u._get_entrypoint()
^^^^^^^^^^^^^^^^^^^
File "/home/airflow/.local/lib/python3.12/site-packages/sqlalchemy/engine/url.py", line 662, in _get_entrypoint
cls = registry.load(name)
^^^^^^^^^^^^^^^^^^^
File "/home/airflow/.local/lib/python3.12/site-packages/sqlalchemy/util/langhelpers.py", line 343, in load
raise exc.NoSuchModuleError(
sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:postgres
What you think should happen instead
A URI for a Postgres-connection added via the UI should either result in:
'postgresql://my_user:my_pw@my_host:5432/my_db'
or
'postgresql+psycopg2://my_user:my_pw@my_host:5432/my_db'
How to reproduce
Add a Postgres-Connection via UI and use the retrieved uri for a db-connection
Anything else
No response
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:providerskind:bugThis is a clearly a bugThis is a clearly a bugneeds-triagelabel for new issues that we didn't triage yetlabel for new issues that we didn't triage yetprovider:postgres