This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new b653b4d165a Remove false-positive RFC3986 underscore warning from 
Connection.get_uri() (#64345)
b653b4d165a is described below

commit b653b4d165a0587800c2a54c292a321c9a93d153
Author: Michael Black <[email protected]>
AuthorDate: Wed Apr 1 13:42:46 2026 -0600

    Remove false-positive RFC3986 underscore warning from Connection.get_uri() 
(#64345)
    
    `get_uri()` warns about underscores in `conn_type`, but standard Airflow
    connection types like `google_cloud_platform` inherently contain 
underscores.
    The warning is not actionable for users since:
    
    1. Standard provider connection types (google_cloud_platform, etc.) are
       defined with underscores by the providers themselves
    2. `get_uri()` already handles this correctly on the very next line by
       converting underscores to dashes: `self.conn_type.lower().replace('_', 
'-')`
    3. Connections stored via Secrets Manager backends trigger this warning
       on every connection retrieval during task execution, producing noisy
       logs with no remediation path
    
    The underscore-to-dash conversion in the URI output remains intact,
    ensuring RFC3986 compliance of the generated URI.
    
    Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
---
 task-sdk/src/airflow/sdk/definitions/connection.py | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/task-sdk/src/airflow/sdk/definitions/connection.py 
b/task-sdk/src/airflow/sdk/definitions/connection.py
index 1cbf75a7bb4..1f4d4052b70 100644
--- a/task-sdk/src/airflow/sdk/definitions/connection.py
+++ b/task-sdk/src/airflow/sdk/definitions/connection.py
@@ -157,11 +157,6 @@ class Connection:
         """Generate and return connection in URI format."""
         from urllib.parse import parse_qsl
 
-        if self.conn_type and "_" in self.conn_type:
-            log.warning(
-                "Connection schemes (type: %s) shall not contain '_' according 
to RFC3986.",
-                self.conn_type,
-            )
         if self.conn_type:
             uri = f"{self.conn_type.lower().replace('_', '-')}://"
         else:

Reply via email to