Skip to content

Remove false-positive RFC3986 underscore warning from Connection.get_uri()#64345

Merged
potiuk merged 2 commits intoapache:mainfrom
MichaelRBlack:fix/secrets-connection-deprecation-warnings
Apr 1, 2026
Merged

Remove false-positive RFC3986 underscore warning from Connection.get_uri()#64345
potiuk merged 2 commits intoapache:mainfrom
MichaelRBlack:fix/secrets-connection-deprecation-warnings

Conversation

@MichaelRBlack
Copy link
Copy Markdown
Contributor

Summary

  • Remove the Connection schemes (type: %s) shall not contain '_' according to RFC3986 warning from Connection.get_uri() in the Task SDK

Motivation

Standard Airflow connection types like google_cloud_platform, ssh_tunnel, and others inherently contain underscores as defined by their respective providers. The current warning fires on every get_uri() call for these standard types, producing noisy logs that users cannot resolve since:

  1. The conn_type values are defined by providers, not by users
  2. get_uri() already correctly handles this by converting underscores to dashes on the next line: self.conn_type.lower().replace('_', '-')
  3. When using Secrets Manager backends (AWS, GCP, etc.), this warning fires on every connection retrieval during task execution

The underscore-to-dash conversion in the URI output remains intact, ensuring the generated URI is RFC3986 compliant.

Test plan

  • Existing test_get_uri test continues to pass (uses mysql type, no underscores)
  • Verify connection types with underscores (e.g., google_cloud_platform) no longer produce spurious warnings
  • Verify get_uri() still produces valid RFC3986 URIs with dashes in the scheme

🤖 Generated with Claude Code

…uri()

`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) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@SameerMesiah97 SameerMesiah97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a perfectly reasonable change but let's wait for CI to run.

@potiuk potiuk added the backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch label Apr 1, 2026
@potiuk potiuk added this to the Airflow 3.2.0 milestone Apr 1, 2026
@potiuk potiuk merged commit b653b4d into apache:main Apr 1, 2026
114 checks passed
@boring-cyborg
Copy link
Copy Markdown

boring-cyborg bot commented Apr 1, 2026

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

github-actions bot pushed a commit that referenced this pull request Apr 1, 2026
…nection.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.
(cherry picked from commit b653b4d)

Co-authored-by: Michael Black <4128408+MichaelRBlack@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

Backport successfully created: v3-2-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
v3-2-test PR Link

github-actions bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Apr 1, 2026
…nection.get_uri() (apache#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.
(cherry picked from commit b653b4d)

Co-authored-by: Michael Black <4128408+MichaelRBlack@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
vatsrahul1001 pushed a commit that referenced this pull request Apr 2, 2026
…nection.get_uri() (#64345) (#64607)

[v3-2-test] Remove false-positive RFC3986 underscore warning from Connection.get_uri()
Co-authored-by: Michael Black <4128408+MichaelRBlack@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Subham-KRLX pushed a commit to Subham-KRLX/airflow that referenced this pull request Apr 3, 2026
…uri() (apache#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) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:task-sdk backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants