Keep asyncpg installed by default in the Postgres provider#69690
Merged
Conversation
Postgres provider 7.0.0 moved asyncpg from a default dependency to an opt-in extra when it made psycopg3 the default async metadata-DB driver. That default only exists on Airflow 3.4.0+, whose async URL derivation can fall back to asyncpg. Airflow cores older than 3.4.0 — all currently released 3.x lines, which this provider still supports (apache-airflow>=2.11.0) — derive the async metadata-DB URL as postgresql+asyncpg:// unconditionally and have no psycopg fallback, so dropping asyncpg leaves their async engine unable to load its driver. Keep asyncpg as a default dependency until the minimum supported Airflow is 3.4.0, so upgrading the provider does not break the async metadata database on the cores it still claims to support.
7fa1fb2 to
be88220
Compare
Dev-iL
approved these changes
Jul 10, 2026
Dev-iL
left a comment
Collaborator
There was a problem hiding this comment.
Thank you for opening this. The reasoning is sound, the implementation looks correct.
vincbeck
approved these changes
Jul 10, 2026
This was referenced Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Postgres provider
7.0.0(currently in RC as7.0.0rc1, #69526 / merged #69089) made psycopg3 the default async metadata-DB driver and, as part of that, movedasyncpgfrom a default dependency to the opt-in[asyncpg]extra.The psycopg-async default and its
postgresql+asyncpg://fallback only exist on Airflow 3.4.0+ (airflow-coresettings.py::_get_async_conn_uri_from_sync). Every currently released 3.x core (3.0–3.3), which this provider still supports (apache-airflow>=2.11.0), derives the async metadata-DB URL aspostgresql+asyncpg://unconditionally and has no psycopg fallback.So upgrading the Postgres provider to
7.0.0on any released 3.x core (or a 3.4.0 deployment that pinned an older core) leaves the async metadata-DB engine unable to load its driver:This is a regression against cores the provider claims to support, and a reason to hold
postgres 7.0.0rc1.Fix
Keep
asyncpgas a default dependency of the Postgres provider until its minimum supported Airflow is3.4.0(i.e. until every supported core knows thepsycopg_asyncfallback). psycopg3 remains the default async driver on 3.4.0+; asyncpg is simply still present so older supported cores keep working. The removal is gated on the floor bump and noted at the workaround site.pyproject.toml: addasyncpg>=0.30.0back to defaultdependencies(comment explains the constraint + tracking issue).changelog.rst: correct the 7.0.0 note — asyncpg stays installed by default; the psycopg_async switch is 3.4.0+ behavior only.README.rst/docs/index.rst/uv.lock: regenerated by prek hooks.The eventual removal (converge on psycopg3-only) is tracked at #68453.
related: #69526
related: #68453
Test plan
Dependency/packaging + changelog change; no Python behavior to unit-test (the affected async-URL derivation lives in
airflow-core, unchanged here). Verified: prekUpdate dependencies for providers,Sync provider README.rst Requirements table with pyproject.toml,Update uv.lock, and changelog-format hooks all pass.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4.8) following the guidelines