Johnny1cyber commented on code in PR #48245:
URL: https://github.com/apache/airflow/pull/48245#discussion_r2016576931


##########
task-sdk/src/airflow/sdk/definitions/connection.py:
##########
@@ -55,8 +56,66 @@ class Connection:
     password: str | None = None
     port: int | None = None
     extra: str | None = None
+    uri: str | None = None
 
-    def get_uri(self): ...
+    EXTRA_KEY = "__extra__"
+
+    def get_uri(self) -> str:
+        """Generate and return connection in URI format."""
+        from urllib.parse import parse_qsl, quote, urlencode
+
+        if self.uri is not None:
+            return self.uri
+
+        if self.conn_type and "_" in self.conn_type:
+            log.warning(
+                "Connection schemes (type: %s) shall not contain '_' according 
to RFC3986.",
+                self.conn_type,
+            )

Review Comment:
   That is something that's done in models.connection. That and the 
substitution of the "_" character with  the "-" character



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