Skip to content

Stop recommending psycopg3 connection strings on older Airflow - #70619

Merged
shahar1 merged 1 commit into
apache:mainfrom
shahar1:fix-psycopg3-docs-airflow2
Sep 11, 2026
Merged

shahar1 merged 1 commit into
apache:mainfrom
shahar1:fix-psycopg3-docs-airflow2

Conversation

@shahar1

@shahar1 shahar1 commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Human Summary

This PR fixes psycopg connection-string guidance for older Airflow versions than 3.2.
It replaces psycopg3 connection strings with psycopg2 for compatibility with those versions.

AI Summary

Click here The amazon executor setup guides and the Celery `result_backend` example tell users to configure a `postgresql+psycopg://` (psycopg3) connection string. Both providers declare `apache-airflow>=2.11.0`, and releases before Airflow 3.2.0 (the first with a `sqlalchemy>=2.0` floor) can run on SQLAlchemy 1.4, which has no `postgresql+psycopg` dialect at all — a user following those instructions gets `sqlalchemy.exc.NoSuchModuleError` at startup, with nothing in the docs indicating the advice was version-specific.

The amazon guides are step-by-step deployment instructions where the connection string is pasted straight into an AWS console field, so the wrong value is especially easy to pick up.

This switches the documented value to postgresql+psycopg2://, which is valid on every Airflow version these providers support, and moves the version guidance into prose so the code block stays copy-pasteable. The three amazon executor guides had the same block duplicated inline; they now include a single shared block from general.rst, matching how the rest of those files already share content. The celery result_backend note also scopes the psycopg3 default to what actually governs it: the derivation applies to a driverless postgresql:// URL when SQLAlchemy 2.0 and psycopg are both installed.

Verified with breeze build-docs amazon celery (build and spellcheck) — both packages pass and all affected pages render correctly.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 5)

Generated-by: Claude Code (Opus 5) following the guidelines

@shahar1
shahar1 force-pushed the fix-psycopg3-docs-airflow2 branch 2 times, most recently from e7acd04 to 0223617 Compare July 28, 2026 15:39
@shahar1
shahar1 marked this pull request as ready for review July 28, 2026 17:45
@shahar1
shahar1 requested review from Dev-iL and potiuk July 28, 2026 17:45
@uranusjr

Copy link
Copy Markdown
Member

If this is for older Airflow, should this be filed to versioned branches instead of main?

@potiuk

potiuk commented Jul 28, 2026

Copy link
Copy Markdown
Member

If this is for older Airflow, should this be filed to versioned branches instead of main?

It's not - providers currently (cc: @eladkal) support Airlfow 2.11+ from main - until we make a decision they don't

@eladkal

eladkal commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

If specific providers will benfit from bumping min airflow version lets talk.

@potiuk

potiuk commented Jul 29, 2026

Copy link
Copy Markdown
Member

If specific providers will benfit from bumping min airflow version lets talk.

I think that's about 100 conversation fior you to have, But yeah, I am interesting to see how many extra conversations and failures to handle it will bring. 👀

Comment thread providers/amazon/docs/executors/general.rst Outdated

@Dev-iL Dev-iL left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Small suggestion, otherwise lgtm

Comment thread providers/amazon/docs/executors/general.rst Outdated
@shahar1
shahar1 requested a review from eladkal August 1, 2026 06:04
@shahar1

shahar1 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

If specific providers will benfit from bumping min airflow version lets talk.

I don't think that specific providers will benefit from that - we'll have to bump to 3.2+ and handle dropping 2.11-3.1 just for a doc example.

@shahar1
shahar1 force-pushed the fix-psycopg3-docs-airflow2 branch from 25bd554 to 9553df9 Compare September 11, 2026 15:30
@shahar1
shahar1 merged commit a1cd080 into apache:main Sep 11, 2026
80 checks passed
@shahar1
shahar1 deleted the fix-psycopg3-docs-airflow2 branch September 11, 2026 18:52
xvega pushed a commit to xvega/airflow that referenced this pull request Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants