Upgrade SQLAlchemy v1 to v2 (Python 3.14 blocker)#3293
Open
Upgrade SQLAlchemy v1 to v2 (Python 3.14 blocker)#3293
Conversation
SQLAlchemy v1 does not support Python 3.14, making this upgrade a blocker. Key changes: - Update setup.py pin from sqlalchemy>=1.4,<2 to sqlalchemy>=2,<3 - Replace removed engine.execute() with connection-based execution using conn.exec_driver_sql() inside a connection context manager - Add _ResultProxy wrapper to eagerly fetch results so they survive connection closure (maintains existing fetchone()/fetchall() API) - Replace LegacyRow (removed in v2) with Row in type annotations - Update test mocks that used spec=LegacyRow to use plain MagicMock() since Row in v2 has a different interface - Add 10 dedicated SQLAlchemy v2 compatibility tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3293 +/- ##
==========================================
+ Coverage 70.10% 72.29% +2.19%
==========================================
Files 56 56
Lines 2398 2422 +24
Branches 419 422 +3
==========================================
+ Hits 1681 1751 +70
+ Misses 641 592 -49
- Partials 76 79 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
sqlalchemy>=1.4,<2tosqlalchemy>=2,<3Rowinstead ofLegacyRowRef: #2822 (comment)
Changes
setup.py: bump SQLAlchemy to v2data.py: replace removedengine.execute()with connection-basedexec_driver_sql()+_ResultProxywrapper*_service.py:LegacyRow→RowTest plan
🤖 Generated with Claude Code