fix(deps): roll back SQLAlchemy 2.0 upgrade - #43260
Conversation
Revert squash commit 8014f78 while preserving the 86 commits subsequently merged to master. Restore SQLAlchemy 1.4.54 and Flask-SQLAlchemy 2.5.1 behavior, including compatible dialect bounds, ORM/session handling, and warning coverage. Requirements were regenerated with ./scripts/uv-pip-compile.sh using the repository's Python 3.11 Docker workflow. The revert applied without textual conflicts. Post-merge session/savepoint and DuckDB changes were retained and verified against SQLAlchemy 1.4; no post-#42803 commit required an additional compatibility change.
Code Review Agent Run #8b0ed2Actionable Suggestions - 0Additional Suggestions - 9
Filtered by Review RulesBito filtered these suggestions based on rules created automatically for your feedback. Manage rules.
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #43260 +/- ##
=======================================
Coverage 66.65% 66.65%
=======================================
Files 2874 2874
Lines 163781 163750 -31
Branches 37798 37796 -2
=======================================
- Hits 109168 109153 -15
+ Misses 52475 52458 -17
- Partials 2138 2139 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@aminghadersohi what is the purpose of this revert? Staying on SQLA 1.x is not sustainable, hence we should fix forward with 2.x rather than reverting to a version that's no longer actively maintained. Do note that we're still in the breaking window, so breakage due to major changes is expected. CC: @rusackas |
Hi @villebro we had some discussions about revert, vs a dual compat pr, vs fix forward so i put up the prs quick. but the vote seems to be 'fix forward' so switching this to draft in case something blocks that plan, but will close this later (probably sooner). thanks for the comment/vote. appreciated as always. |
|
Closing this in favor of fixing forward on SQLAlchemy 2.0. We are keeping the SQLAlchemy 2 upgrade, updating and qualifying the downstream driver fleet, adding a machine-readable driver inventory/drift gate, and introducing real runtime coverage for materially used connectors rather than retaining the rollback path. The first Shell implementation is preset-io/superset-shell#4845, with follow-up work planned for Athena qualification, DataFusion restoration, customer-usage prioritization, and permanent connector canaries. |
SUMMARY
Reverts #42803 (
8014f782d3c702487c6afaa40e2389210a915f91), restoring the dependency set and compatible behavior from immediately before the SQLAlchemy 2.0 / Flask-SQLAlchemy 3.1.1 upgrade:This is a semantic revert of the exact squash commit, rebased onto current
master. It preserves the 88 commits merged after #42803 rather than resetting affected files wholesale.requirements/base.txt,requirements/development.txt, andrequirements/translations.txtwere regenerated with the repository's./scripts/uv-pip-compile.shDocker/Python 3.11 workflow.The revert applied without textual conflicts. Post-#42803 changes with plausible SQLAlchemy coupling were reviewed and retained:
4684851336), nested SAVEPOINT handling: supported by SQLAlchemy 1.4 and covered by tests.d0658bacc8), MCP per-call session isolation: explicitly supports Flask-SQLAlchemy 2.5.1 and is covered by tests.2773bc94eb),sqlalchemy-bigquery1.17.2: resolves against SQLAlchemy 1.4.54.3fb58900b9), DuckDB cursor workaround removal: real-cursor test passes with SQLAlchemy 1.4.54, duckdb-engine 0.17.0, and duckdb 1.5.5.No post-#42803 commit required an additional compatibility change.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Not applicable; backend dependency rollback only.
TESTING INSTRUCTIONS
Dependency artifacts:
Targeted PR compatibility tests:
pytest -q \ tests/unit_tests/extensions/test_sqlalchemy.py \ tests/unit_tests/commands/dataset/test_duplicate.py \ tests/unit_tests/commands/importers/v1/examples_test.py \ tests/unit_tests/databases/filters_test.py \ tests/unit_tests/db_engine_specs/test_snowflake.py \ tests/unit_tests/db_engine_specs/test_trino.py \ tests/unit_tests/sql_lab_test.py # 175 passedPost-merge session/SAVEPOINT compatibility:
pytest -q \ tests/unit_tests/charts/commands/importers/v1/import_test.py \ tests/unit_tests/mcp_service/test_session_scope.py \ tests/unit_tests/mcp_service/test_auth_user_resolution.py # 52 passed, 4 skippedDuckDB compatibility:
pytest -q tests/unit_tests/db_engine_specs/test_duckdb.py # 9 passedPre-commit checks:
pre-commit run --from-ref origin/master --to-ref HEAD # passedADDITIONAL INFORMATION