bump sqla to 2.1 #20650
<!-- codex-pull-request-review-summary -->
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
| Review | Status | Commit | Review trigger |
| --- | --- | --- | --- |
| 📝 Code Review | ✅ Completed <relative-time datetime="2026-10-02T16:48:37.031276Z">2026-10-02T16:48:37.031276Z</relative-time> | 7393fd8 | PR opened |
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
</details>
@alc-alc please review 🥹
just my personal preference, I like to use type statement for aliases, only noticed because the diff highlighted it 😅, unsure if there are other places where aliases are used.
Approved these changes.
Changed to a type statement in 028724a9f. TypoCheckMatch already uses this style; left the other aliases alone.
Alc-Alc
JacobCoffee
Bump to 2.1, adjust to new syntax
Here is a breakdown of the new 2.1 stuff that was required to change:
| Change | Simple explanation |
| --- | --- |
|
.distinct(column)→.ext(distinct_on(column))| New supported syntax for PostgreSQLDISTINCT ON..ext()attaches that SQL feature to the query. Same SQL behavior. ||
Row[tuple[int, str]]→Row[int, str]| SQLAlchemy 2.1 takes each column’s type separately.Remove the outer
tuple. ||
Select[tuple[int]]→Select[int]| Same change: this query returns one integer column. ||
Select[Any]→Select[tuple[Any, ...]]| Means “a query returning any number of columns.”The
unpacks the column types. Same idea forRow. ||
NotNullable(column)| Tells the type checker the value cannot beNone. The existing queryalready excludes nulls; this adds no filtering. |
|
desc(column)→column.desc()| Same ordering, with a more precise type annotation. Likewisefor
.nulls_last(). ||
Alias = ...→type Alias = ...| Explicitly declares a Python type alias. Optional styleimprovement from @Alc-Alc , not required by SQLAlchemy. |