Repository navigation
Support SQLAlchemy 2.1 - #4364
Merged
Merged
Conversation
SQLAlchemy was capped below 2.1 because sqlalchemy-utils didn't support it (kvesteri/sqlalchemy-utils#800). sqlalchemy-utils 0.43.0 adds SQLAlchemy 2.1 support, so require it and drop the cap. Python 3.10, which SQLAlchemy 2.1 doesn't support, still gets 2.0. Also: * delete_metrics() no longer runs its two DELETE statements concurrently with asyncio.gather() in separate sessions. In tests, StaticPool makes both sessions share one SQLite connection. In 2.1, the aiosqlite adapter runs execute + fetchall under a per-connection mutex that commit() doesn't take, so one session's COMMIT could land between the other session's DELETE ... RETURNING and its fetch, and fail with "cannot commit transaction - SQL statements in progress". Under 2.0 the interleaving happened to be safe. Production uses a connection pool, so only tests were affected. Both deletes now run in one session. * noload() is deprecated in 2.1. Replace it with raiseload(), which also skips the mapped lazy="selectin" load, but raises on access instead of returning an empty collection. RunModel.jobs isn't read after list_projects_run_models(), so the swap is enough there. FleetModel.instances is read downstream for candidate fleets that have no matching instances, so set it to an empty list explicitly with set_committed_value(). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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.
SQLAlchemy was capped below 2.1 because sqlalchemy-utils didn't support it (kvesteri/sqlalchemy-utils#800). sqlalchemy-utils 0.43.0 adds SQLAlchemy 2.1 support, so require it and drop the cap. Python 3.10, which SQLAlchemy 2.1 doesn't support, still gets 2.0.
Also: