Skip to content

Do not warn about bare postgresql:// metadata DB URLs - #74863

Merged
jedcunningham merged 1 commit into
apache:mainfrom
astronomer:postgresql-scheme-warning
Oct 16, 2026
Merged

jedcunningham merged 1 commit into
apache:mainfrom
astronomer:postgresql-scheme-warning

Conversation

@jedcunningham

Copy link
Copy Markdown
Member

Airflow emitted a FutureWarning ("Bad scheme ... You must change to postgresql+psycopg") for bare postgresql:// metadata DB URLs. Those URLs are valid: Airflow only rewrites them to make the driver explicit (postgresql+psycopg if psycopg 3 is installed, otherwise postgresql+psycopg2). Users read the warning as "driver-less URLs are deprecated".

This change:

  • stops warning for bare postgresql:// (the rewrite itself is unchanged);
  • keeps the warning for the actually unsupported postgres:// and postgres+psycopg2:// schemes, reworded to say what Airflow does and that postgresql (driver picked by Airflow) is a valid fix; the outdated SQLAlchemy 1.4 / Airflow 2.3 reference and the "before the next Airflow release" deadline are dropped;
  • updates the _upgrade_postgres_metastore_conn docstring accordingly;
  • adds a test that the warning is emitted only for postgres / postgres+psycopg2, and not for bare postgresql.

The bare postgresql scheme is valid in SQLAlchemy; Airflow only rewrites
it to make the driver explicit. It nevertheless emitted the old "Bad
scheme ... You must change to postgresql+psycopg" FutureWarning, which
users read as driver-less URLs being deprecated.

Only warn for the unsupported postgres and postgres+psycopg2 schemes,
reword that warning (no outdated SQLAlchemy 1.4 / Airflow 2.3 reference
or release deadline), update the docstring, and add a test.
@jedcunningham jedcunningham added this to the Airflow 3.4.0 milestone Oct 16, 2026
@jedcunningham jedcunningham added the backport-to-v3-4-test Backport to v3-4-test label Oct 16, 2026
@jedcunningham
jedcunningham merged commit 8317410 into apache:main Oct 16, 2026
79 checks passed
@jedcunningham
jedcunningham deleted the postgresql-scheme-warning branch October 16, 2026 17:15
@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-4-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-4-test PR Link

vatsrahul1001 pushed a commit that referenced this pull request Oct 17, 2026
…4863) (#74884)

The bare postgresql scheme is valid in SQLAlchemy; Airflow only rewrites
it to make the driver explicit. It nevertheless emitted the old "Bad
scheme ... You must change to postgresql+psycopg" FutureWarning, which
users read as driver-less URLs being deprecated.

Only warn for the unsupported postgres and postgres+psycopg2 schemes,
reword that warning (no outdated SQLAlchemy 1.4 / Airflow 2.3 reference
or release deadline), update the docstring, and add a test.
(cherry picked from commit 8317410)

Co-authored-by: Jed Cunningham <[email protected]>
vatsrahul1001 pushed a commit that referenced this pull request Oct 20, 2026
…4863) (#74884)

The bare postgresql scheme is valid in SQLAlchemy; Airflow only rewrites
it to make the driver explicit. It nevertheless emitted the old "Bad
scheme ... You must change to postgresql+psycopg" FutureWarning, which
users read as driver-less URLs being deprecated.

Only warn for the unsupported postgres and postgres+psycopg2 schemes,
reword that warning (no outdated SQLAlchemy 1.4 / Airflow 2.3 reference
or release deadline), update the docstring, and add a test.
(cherry picked from commit 8317410)

Co-authored-by: Jed Cunningham <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-v3-4-test Backport to v3-4-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants