Skip to content

[4.x] Require SQLAlchemy 2.0.44 (GH-1584) - #1623

Merged
laughingman7743 merged 1 commit into
4.xfrom
fix/1584-4x-sqlalchemy-floor
Nov 30, 2026
Merged

laughingman7743 merged 1 commit into
4.xfrom
fix/1584-4x-sqlalchemy-floor

Conversation

@laughingman7743

Copy link
Copy Markdown
Member

WHAT

Release note (4.4.0, installation): SQLAlchemy 2.0.23 to 2.0.43 no longer satisfy the sqlalchemy and aiosqlalchemy extras.

WHY

Closes #1584. The maintainer decided to raise the 4.x minimum within SQLAlchemy 2.0 before tagging 4.4.0.

Below 2.0.44, the 4.x dialect has the three defects that the #1494 addendum records for 4.x and master:

  • On 2.0.23 to 2.0.27, an insertmanyvalues insert raises AttributeError after its first statement has run, so a retry can insert those rows again.
  • On 2.0.23 to 2.0.39, CHAR(n) and VARCHAR(n) fail to compile.
  • On 2.0.23 to 2.0.43, 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 compile CREATE TABLE before 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.
  • Offline SQLAlchemy tests on Python 3.12 (-m "not aws" tests/pyathena/sqlalchemy tests/pyathena/aio/sqlalchemy, with the just test offline environment):
  • The compliance suites (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

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>
Comment thread pyproject.toml

[project.optional-dependencies]
sqlalchemy = ["sqlalchemy>=2.0.23"]
sqlalchemy = ["sqlalchemy>=2.0.44"]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 grep outside uv.lock, tox.ini and .github included).
  • 4.x has no SQLAlchemy version-conditional code in pyathena/sqlalchemy, pyathena/aio/sqlalchemy or the tests, so no branch becomes dead.
  • Locked SQLAlchemy stays 2.0.46; uv lock --locked passes 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.

Comment thread docs/sqlalchemy.md
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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-review round 2 (claims, callers, operations), head 191dbe5.

Claims checked:

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.

Comment thread pyproject.toml
sqlalchemy = ["sqlalchemy>=2.0.44"]
aiosqlalchemy = [
"sqlalchemy[asyncio]>=2.0.23",
"sqlalchemy[asyncio]>=2.0.44",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."

@laughingman7743
laughingman7743 marked this pull request as ready for review November 30, 2026 14:17
@laughingman7743
laughingman7743 merged commit 0b909e1 into 4.x Nov 30, 2026
17 checks passed
@laughingman7743
laughingman7743 deleted the fix/1584-4x-sqlalchemy-floor branch November 30, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant