Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add CI support for SQLAlchemy 2.0#52233

Merged
potiuk merged 6 commits intoapache:mainfrom
Dev-iL:Dev-iL/2506/sqla-v2-tests
Aug 10, 2025
Merged

Add CI support for SQLAlchemy 2.0#52233
potiuk merged 6 commits intoapache:mainfrom
Dev-iL:Dev-iL/2506/sqla-v2-tests

Conversation

Copy link
Collaborator

Dev-iL commented Jun 25, 2025 *
edited
Loading

closes: #48953, #52663
related: #28723, #50960 (prerequisite that's included in this PR)

  • Add the check_upgrade_sqlalchemy container entrypoint for testing SQLA v2 on CI
  • Fix some existing shellcheck violations reported by shellcheck-py.
  • Robustify multiple unit tests and amend some business logic.

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

Copilot AI review requested due to automatic review settings June 25, 2025 09:29
Dev-iL requested review from ashb, gopidesupavan and potiuk as code owners June 25, 2025 09:29
boring-cyborg bot added area:dev-tools backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch labels Jun 25, 2025

This comment was marked as outdated.

Dev-iL force-pushed the Dev-iL/2506/sqla-v2-tests branch from 96d2e8d to 482fff4 Compare June 25, 2025 09:51
Dev-iL requested review from amoghrajesh and jedcunningham as code owners June 25, 2025 09:51
Dev-iL requested a review from Copilot June 25, 2025 09:55
Copilot AI reviewed Jun 25, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new entrypoint function, check_upgrade_sqlalchemy, to handle upgrading SQLAlchemy for testing SQLA v2 while also addressing several shellcheck violations.

  • Adds check_upgrade_sqlalchemy implementations to both scripts/docker/entrypoint_ci.sh and Dockerfile.ci.
  • Updates Breeze parameters, commands, and CI workflow to include an upgrade_sqlalchemy flag.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
scripts/docker/entrypoint_ci.sh Adds check_upgrade_sqlalchemy function with minor quoting adjustments.
scripts/ci/docker-compose/devcontainer.env Introduces UPGRADE_SQLALCHEMY environment variable.
dev/breeze/src/airflow_breeze/params/shell_params.py Adds new boolean parameter upgrade_sqlalchemy.
dev/breeze/src/airflow_breeze/commands/developer_commands.py Adds upgrade_sqlalchemy option to developer commands.
dev/breeze/src/airflow_breeze/commands/common_options.py Adds a new click option for upgrade_sqlalchemy with help text.
Dockerfile.ci Adds check_upgrade_sqlalchemy function similar to the entrypoint script.
.github/workflows/run-unit-tests.yml Adds upgrade-sqlalchemy input to the CI workflow.
Comments suppressed due to low confidence (1)

dev/breeze/src/airflow_breeze/commands/common_options.py:157

  • [nitpick] The help text for the upgrade_sqlalchemy option mentions an 'experimental supported version'; consider revising it to clearly indicate that it upgrades SQLAlchemy to the latest version required for running tests, ensuring consistency with the function output.
option_upgrade_sqlalchemy = click.option(

Dev-iL force-pushed the Dev-iL/2506/sqla-v2-tests branch 4 times, most recently from d3dd43d to d55a749 Compare June 25, 2025 13:09
Dev-iL requested a review from vincbeck as a code owner June 25, 2025 13:09
Copy link
Collaborator Author

Dev-iL commented Jun 25, 2025

The tests are failing as expected on SQLA v2 incompatibilities. Now what? Should I suggest in #28723 that developers rebase to my branch?

Copy link
Member

potiuk commented Jun 25, 2025

Yes. And make it a part of your PR and we can continuously rebase the PRs on top of yours. This is going to be a little involved and require rebasing here and there.

Dev-iL requested a review from XD-DENG as a code owner June 25, 2025 15:01
Dev-iL requested a review from ephraimbuddy as a code owner June 25, 2025 15:47
Copy link
Collaborator Author

Dev-iL commented Jun 25, 2025

Should we perhaps decide on a single "main" branch (e.g. your one) and target the various SQLA2 PRs into it? Just to save the effort of rebasing across multiple forks...

Dev-iL force-pushed the Dev-iL/2506/sqla-v2-tests branch 2 times, most recently from 7bde1ac to 34e7502 Compare June 26, 2025 15:43
Dev-iL marked this pull request as draft June 28, 2025 06:37
Dev-iL force-pushed the Dev-iL/2506/sqla-v2-tests branch 5 times, most recently from 5efe8cb to 9cb0ba2 Compare June 29, 2025 13:44
Dev-iL force-pushed the Dev-iL/2506/sqla-v2-tests branch 13 times, most recently from bb95354 to c6b5a04 Compare July 24, 2025 09:12
potiuk added the debug ci resources Set it on PR if you want to debug resource usage for it label Jul 24, 2025
potiuk force-pushed the Dev-iL/2506/sqla-v2-tests branch from c6b5a04 to c8dc921 Compare July 24, 2025 11:13
Dev-iL force-pushed the Dev-iL/2506/sqla-v2-tests branch from c8dc921 to 907e709 Compare July 24, 2025 11:14
potiuk removed the debug ci resources Set it on PR if you want to debug resource usage for it label Jul 24, 2025
potiuk mentioned this pull request Jul 29, 2025
Dev-iL mentioned this pull request Aug 2, 2025
Dev-iL and others added 6 commits August 10, 2025 16:34
+ Fix some SQLA2 incompatibilities
+ Skip multiple tests that rely on FAB
Might help with the MySQL 8.4 + Py3.13 combination
- Make some tests more specific so as not trip on irrelevant things.
- Add a couple of fixtures to ensure a predictable engine state.
- Replace uses of unittest.mock with the mocker fixture.
- Add tests for `AutocommitEngineForMySQL`.
potiuk approved these changes Aug 10, 2025
Copy link
Member

potiuk commented Aug 10, 2025

LGTM. The MyPy fix has been fixed separated (leaving some TODOs: in type checking #54321

Dev-iL reacted with rocket emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

uranusjr uranusjr left review comments

Copilot code review Copilot Copilot left review comments

potiuk potiuk approved these changes

ashb Awaiting requested review from ashb ashb is a code owner

gopidesupavan Awaiting requested review from gopidesupavan gopidesupavan is a code owner

jedcunningham Awaiting requested review from jedcunningham jedcunningham is a code owner

amoghrajesh Awaiting requested review from amoghrajesh amoghrajesh is a code owner

vincbeck Awaiting requested review from vincbeck

XD-DENG Awaiting requested review from XD-DENG

ephraimbuddy Awaiting requested review from ephraimbuddy ephraimbuddy is a code owner

kaxil Awaiting requested review from kaxil kaxil is a code owner

eladkal Awaiting requested review from eladkal

o-nikolas Awaiting requested review from o-nikolas o-nikolas is a code owner

Assignees

No one assigned

Labels

all versions If set, the CI build will be forced to use all versions of Python/K8S/DBs area:dev-tools

Projects

None yet

Milestone

Airflow 3.1.0

Development

Successfully merging this pull request may close these issues.

Add tests for SQLAlchemy 2

6 participants