-
Notifications
You must be signed in to change notification settings - Fork 17.7k
chore(backend): Bump SQLAlchemy to version 2. #39736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,7 +49,7 @@ def upgrade(): | |
| clusters = sa.Table("clusters", metadata, autoload=True) | ||
|
|
||
| statement = datasources.update().values( | ||
| cluster_id=sa.select([clusters.c.id]) | ||
| cluster_id=sa.select(clusters.c.id) | ||
| .where(datasources.c.cluster_name == clusters.c.cluster_name) | ||
| .as_scalar() | ||
| ) | ||
|
|
@@ -91,7 +91,7 @@ def downgrade(): | |
| clusters = sa.Table("clusters", metadata, autoload=True) | ||
|
|
||
| statement = datasources.update().values( | ||
| cluster_name=sa.select([clusters.c.cluster_name]) | ||
| cluster_name=sa.select(clusters.c.cluster_name) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: The downgrade statement also keeps using Severity Level: Major
|
||
| .where(datasources.c.cluster_id == clusters.c.id) | ||
| .as_scalar() | ||
| ) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: This subquery is still chained with
.as_scalar()in the following line, which is removed in SQLAlchemy 2.x forSelectobjects. The migration will fail at runtime when building the update statement; switch this subquery toscalar_subquery()so upgrade runs correctly under SQLAlchemy 2. [possible bug]Severity Level: Critical 🚨
Steps of Reproduction ✅
Fix in Cursor | Fix in VSCode Claude
(Use Cmd/Ctrl + Click for best experience)
Prompt for AI Agent 🤖