uranusjr commented on code in PR #26765:
URL: https://github.com/apache/airflow/pull/26765#discussion_r1059236954
##########
airflow/models/connection.py:
##########
@@ -206,13 +206,16 @@ def _parse_from_uri(self, uri: str):
def get_uri(self) -> str:
"""Return connection in URI format"""
- if "_" in self.conn_type:
+ if self.conn_type and "_" in self.conn_type:
self.log.warning(
"Connection schemes (type: %s) shall not contain '_' according
to RFC3986.",
self.conn_type,
)
- uri = f"{str(self.conn_type).lower().replace('_', '-')}://"
+ if self.conn_type:
+ uri = f"{str(self.conn_type).lower().replace('_', '-')}://"
Review Comment:
Is this `str` cast still needed now this is only called when
`self.conn_type` is not None?
--
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]