enchant3dmango commented on code in PR #47709:
URL: https://github.com/apache/airflow/pull/47709#discussion_r1993465511


##########
airflow/models/connection.py:
##########
@@ -256,6 +256,9 @@ def get_uri(self) -> str:
 
         if self.conn_type:
             uri = f"{self.conn_type.lower().replace('_', '-')}://"
+            if self.conn_type == "postgres":
+                driver = self.extra_dejson.get("postgres_driver", "postgres")
+                uri = uri.replace("postgres://", f"{driver}://", 1)

Review Comment:
   ```suggestion
               if self.conn_type == "postgres":
                   designator = self.extra_dejson.get("designator", "postgres")
                   uri = uri.replace("postgres://", f"{designator}://", 1)
   ```



##########
airflow/models/connection.py:
##########
@@ -256,6 +256,9 @@ def get_uri(self) -> str:
 
         if self.conn_type:
             uri = f"{self.conn_type.lower().replace('_', '-')}://"
+            if self.conn_type == "postgres":
+                driver = self.extra_dejson.get("postgres_driver", "postgres")
+                uri = uri.replace("postgres://", f"{driver}://", 1)

Review Comment:
   Also, please add the `designator` documentation in the [PostgreSQL 
Extra](https://github.com/apache/airflow/blob/main/providers/postgres/docs/connections/postgres.rst?plain=1#L49)
 documentation.



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