sehajsandhu123 commented on code in PR #72000:
URL: https://github.com/apache/airflow/pull/72000#discussion_r3890466506


##########
providers/postgres/src/airflow/providers/postgres/hooks/postgres.py:
##########
@@ -192,7 +218,7 @@ def sqlalchemy_url(self) -> URL:
         if conn.extra_dejson.get("iam", False):
             conn.login, conn.password, conn.port = self.get_iam_token(conn)
         return URL.create(
-            drivername="postgresql+psycopg" if USE_PSYCOPG3 else "postgresql",
+            drivername=self.sqlalchemy_scheme,

Review Comment:
   @ashb  It's primarily a connection property, the hook param is just an 
override on top. The intended usage is setting it once on the connection (or 
not setting it at all is also fine, for backwards compatibility) and the hook 
param only kicks in if explicitly passed.
   
   The reason I added it is if most dags on a connection are fine on psycopg3 
and only one or two break, it pins just those tasks instead of rolling the 
whole connection back to psycopg2. Keeps the opt-out small and lets the 
connection default move forward.
   
   Happy to drop the hook param if you just want the connection extra.



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