uranusjr commented on code in PR #27796:
URL: https://github.com/apache/airflow/pull/27796#discussion_r1027622569
##########
airflow/models/connection.py:
##########
@@ -212,7 +212,9 @@ def get_uri(self) -> str:
self.conn_type,
)
- uri = f"{str(self.conn_type).lower().replace('_', '-')}://"
+ # SQLAlchemy expects postgresql:// as scheme
+ scheme = "postgresql" if self.conn_type == "postgres" else
self.conn_type
+ uri = f"{str(scheme).lower().replace('_', '-')}://"
Review Comment:
```suggestion
self.conn_type == "postgres":
scheme = "postgresql"
else:
scheme = self.conn_type.lower().replace("_", "-")
uri = f"{scheme}://"
```
No need to do the lower-replace combo on the “postgresql” literal.
--
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]