You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/12/30 04:22:04 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #26765: Allow generation of connection URI to work when no conn type

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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org