Breeze: Make postgres driver explicit and version-aware - #70496
Conversation
|
There are some errors to fix ? |
|
@Dev-iL - maybe you can take a look ? |
b2a2b25 to
728457d
Compare
|
Ok so here's the deal:
|
728457d to
c3eb6d1
Compare
…es backend apache#69469 moved Breeze's compose file to a bare `postgresql://` so core's autodetection would select psycopg3. On main that scheme is in `bad_schemes`, so a Breeze session running from sources now emits a FutureWarning at config load. Name the driver explicitly instead, matching the celery result backend URL one line below. Generated-by: Claude Code (Fable 5)
Making the driver explicit silences the FutureWarning that a Breeze postgres session running from sources emits, but migration tests install a released Airflow into the same container, and releases before 3.2.0 can run on SQLAlchemy 1.4, which has no postgresql+psycopg dialect at all. Selecting the driver per installed Airflow keeps runs from sources on psycopg3, which main selects by default, without breaking the legs that install a release.
c3eb6d1 to
5b628d3
Compare
|
Huh, CI was green earlier |
Unrelated to this PR, main is currently broken. Trying to work on a fix :) |
Backport failed to create: v3-3-test. View the failure log Run detailsNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
You can attempt to backport this manually by running: cherry_picker 221da63 v3-3-testThis should apply the commit to the v3-3-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continueIf you don't have cherry-picker installed, see the installation guide. |
Since #69469 moved Breeze's
backend-postgres.ymlto a barepostgresql://scheme (so that core's autodetection selects psycopg3), every Breeze postgres session running Airflow from sources emits aFutureWarningat config load —mainnow lists the bare scheme inbad_schemes.Making the driver explicit has to be version-aware: the migration tests install a released Airflow into the same container, no released version ships psycopg (v3) in its default constraints, and releases before 3.2.0 can run on SQLAlchemy 1.4, which has no
postgresql+psycopgdialect at all — an explicit psycopg3 URL crashes them withsqlalchemy.exc.NoSuchModuleError(this is exactly what failed the Postgres core jobs on this PR's first revision).Breeze now derives
POSTGRES_DRIVERfrom--use-airflow-version— psycopg2 when a released version is installed, psycopg for sources/wheel/sdist/branch/PR installs — and the compose file interpolates it into bothsql_alchemy_connand the Celery result backend URL, defaulting to psycopg.Verified locally: the Airflow 2.11.0 migration leg resolves
postgresql+psycopg2://and completes, and a from-sources session resolvespostgresql+psycopg://with noFutureWarning.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Fable 5, Opus 5) following the guidelines