Repository navigation
[4.x] Require SQLAlchemy 2.0.44 (GH-1584) - #1623
Conversation
Raise the minimum SQLAlchemy of the sqlalchemy and aiosqlalchemy extras and the dev group from 2.0.23 to 2.0.44, as #1508 did on master. Below 2.0.44 the 4.x dialect has the defects recorded on #1494: an insertmanyvalues insert raises AttributeError after its first statement on 2.0.23-2.0.27, CHAR(n)/VARCHAR(n) fail to compile on 2.0.23-2.0.39, and any_()/all_() over an array skip the element type's bind processing on 2.0.23-2.0.43. The offline SQLAlchemy tests fail 11 cases on 2.0.23 and pass on 2.0.44. uv.lock changes only the three SQLAlchemy specifiers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
||
| [project.optional-dependencies] | ||
| sqlalchemy = ["sqlalchemy>=2.0.23"] | ||
| sqlalchemy = ["sqlalchemy>=2.0.44"] |
There was a problem hiding this comment.
Self-review round 1 (behavior and implementation), head 191dbe5.
Inventory: the install requirement of the sqlalchemy/aiosqlalchemy extras and the dev group (pyproject.toml, the three uv.lock specifiers), and the stated minimum in README.md, docs/introduction.md, docs/sqlalchemy.md.
- No other reference to 2.0.23-2.0.43 remains (
git grepoutside uv.lock, tox.ini and .github included). - 4.x has no SQLAlchemy version-conditional code in
pyathena/sqlalchemy,pyathena/aio/sqlalchemyor the tests, so no branch becomes dead. - Locked SQLAlchemy stays 2.0.46;
uv lock --lockedpasses with only the specifiers changed. - Behavior evidence: offline SQLAlchemy tests 2.0.23 11 failed / 2.0.44 591 passed / 2.0.52 7 failed (the [4.x] Take SQLAlchemy DDL options in connect_args from the first connection (adapted #1559) #1594 limitation).
Findings: none. Repairs: none.
| Install SQLAlchemy with `pip install "SQLAlchemy>=2.0.23"` or `pip install PyAthena[sqlalchemy]`. | ||
| Supported SQLAlchemy is 2.0.23 or higher. | ||
| Install SQLAlchemy with `pip install "SQLAlchemy>=2.0.44"` or `pip install PyAthena[sqlalchemy]`. | ||
| Supported SQLAlchemy is 2.0.44 or higher. |
There was a problem hiding this comment.
Self-review round 2 (claims, callers, operations), head 191dbe5.
Claims checked:
- "Run SQLAlchemy statements in pyformat under the global qmark (GH-1485) #1508 set 2.0.44 on master": Run SQLAlchemy statements in pyformat under the global qmark (GH-1485) #1508 body, "The supported SQLAlchemy is now 2.0.44 or higher". "master has since moved to 2.0.52 (Require SQLAlchemy 2.0.52 (GH-1574) #1600)":
origin/master:pyproject.tomlhas>=2.0.52. - The three defects below 2.0.44 and their version ranges: the Settle how SQLAlchemy and to_sql() write values and options into SQL text #1494 addendum and Run SQLAlchemy statements in pyformat under the global qmark (GH-1485) #1508's measurement (2.0.27, 2.0.39, 2.0.40, 2.0.43, 2.0.44); this PR's own run on 4.x reproduces the 2.0.23 failures and the 2.0.44 pass.
- "7 pre-connect tests fail on 2.0.48 and 2.0.52, accepted in [4.x] Take SQLAlchemy DDL options in connect_args from the first connection (adapted #1559) #1594": [4.x] Take SQLAlchemy DDL options in connect_args from the first connection (adapted #1559) #1594 "Known limitations on SQLAlchemy 2.0.48 and later"; reproduced on 2.0.52 (7 failed).
- "locked SQLAlchemy stays 2.0.46": the uv.lock entry for sqlalchemy is 2.0.46.
Existing callers: an environment pinned to SQLAlchemy 2.0.23-2.0.43 no longer resolves PyAthena 4.4.0 with the extras; the release-note line in the body covers it. 2.0.44 imports on Python 3.15.2, where 2.0.23 did not. No AWS request changes.
Docs: README, introduction and sqlalchemy.md state 2.0.44; no other prose names the old minimum.
Evidence limits: the compliance suites were not run at 2.0.44 (CI runs them at 2.0.46 when Ready). Findings: none.
| sqlalchemy = ["sqlalchemy>=2.0.44"] | ||
| aiosqlalchemy = [ | ||
| "sqlalchemy[asyncio]>=2.0.23", | ||
| "sqlalchemy[asyncio]>=2.0.44", |
There was a problem hiding this comment.
Independent review (relayed): Codex CLI (codex exec -s read-only, default model/profile), static review only (no tests run by the reviewer).
Base a23d009, head 191dbe5; detached clean snapshot of the head, verified unchanged afterwards. The prompt had the literal diff and the review questions only (no PR number, description, or prior findings).
Covered: the sync and async dialects against SQLAlchemy 2.0.44 and 2.0.46 (compiler hooks, _rowcount, reflection interfaces, async adapters); README, docs, packaging metadata, .github/ workflows and the tox configuration in pyproject.toml; consistency of the three SQLAlchemy specifiers in pyproject.toml and uv.lock, and the locked 2.0.46.
Result: CLEAN. "I found no dialect API that requires a later release."
WHAT
sqlalchemy>=2.0.44on4.xfor thesqlalchemyandaiosqlalchemyextras and the dev group (was>=2.0.23), and update the version inREADME.md,docs/introduction.mdanddocs/sqlalchemy.md. This is the minimum that Run SQLAlchemy statements in pyformat under the global qmark (GH-1485) #1508 set on master; master has since moved to 2.0.52 (Require SQLAlchemy 2.0.52 (GH-1574) #1600).uv.lockchanges only the three SQLAlchemy specifiers; the locked SQLAlchemy stays 2.0.46.Release note (4.4.0, installation): SQLAlchemy 2.0.23 to 2.0.43 no longer satisfy the
sqlalchemyandaiosqlalchemyextras.WHY
Closes #1584. The maintainer decided to raise the
4.xminimum within SQLAlchemy 2.0 before tagging 4.4.0.Below 2.0.44, the
4.xdialect has the three defects that the #1494 addendum records for4.xand master:AttributeErrorafter its first statement has run, so a retry can insert those rows again.CHAR(n)andVARCHAR(n)fail to compile.any_()/all_()over an array skip the bind processing of the element type and render a wrong value.2.0.44 is the first version on which all three work. 2.0.52 (master's minimum) is not used here: on
4.x, 7 tests that compileCREATE TABLEbefore any connection fail on SQLAlchemy 2.0.48 and 2.0.52, a limitation accepted in #1594.TEST
Tested commit: 191dbe5
just lint,just docs lint,uv lock --locked: passed.just test offline: 4232 passed.-m "not aws" tests/pyathena/sqlalchemy tests/pyathena/aio/sqlalchemy, with thejust test offlineenvironment):test_bound_indices_and_values_are_reused_without_mutation,test_insertmanyvalues_*,test_ddl_and_cast_types[...VARCHAR],test_create_table_location).CREATE TABLEtests of [4.x] Take SQLAlchemy DDL options in connect_args from the first connection (adapted #1559) #1594, as above).just test sqla,just test sqla-async) run in CI on the locked 2.0.46 when the PR is marked Ready; they were not run at 2.0.44.🤖 Generated with Claude Code