andersbogsnes commented on issue #27474:
URL: https://github.com/apache/airflow/issues/27474#issuecomment-1309179318

   Someone from my team ran into a similar problem. I believe the problem stems 
from this line: 
https://github.com/apache/airflow/blob/main/airflow/models/connection.py#L215.
   
   If you use `BaseHook.get_connection()` passing in a "Postgres" type 
connection, the `conn_type` will be "postgres": 
https://github.com/apache/airflow/blob/main/airflow/providers/postgres/hooks/postgres.py#L66,
 meaning the final uri will start with `postgres` instead of `postgresql`.
   
   The fix as I see it, is to use either `BaseHook.get_hook(conn_id).get_uri()` 
if you want a generic solution or to use the `PostgresHook` directly but I 
guess the question is whether or not `BaseHook.get_uri()` is supposed to render 
the uri correctly in all cases?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to