Repository navigation
Test SQLAlchemy offline on the declared minimum and the latest release (GH-1543) - #1620
Conversation
GH-1543) CI ran the SQLAlchemy tests only on the locked version, so defects at the declared minimum and on new releases (#1542, #1563, #1569) went unnoticed. Add `just test offline-sqla <min|latest|VERSION>`: uv resolves the lowest and the highest release that the extras allow, and the recipe runs the dialect tests that need no AWS on it and collects the compliance suites (synchronous and async), which imports them without connecting. The offline environment moves to a shared _offline recipe, used by `just test offline` too. A new offline-sqla job runs the minimum on Python 3.11 and the latest on Python 3.15 for every event. The AWS suites do not wait for it, so a new SQLAlchemy release that breaks it does not stop unrelated pull requests. On SQLAlchemy 2.1, NameDenormalizeTest reads column names from the result; Athena returns them in lowercase, including quoted names. Skip those statements and keep the core select, which maps by position. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…minimum (GH-1543) From self-review: build the inner uv command as a bash array, so the requirement is not word-split or globbed; let the runs inside _offline use only uv's cache (--offline), since they start after the proxy settings are removed; default `just test offline-sqla` to `min`; note that the Release workflow requires the job, and add its matrix to the Python-version sync comment; place the new docs after the offline target's scope paragraph and describe the contribution-guide scope as the dialect tests that need no AWS plus collection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| # allow, resolved by uv; any other value is a version. The packages are | ||
| # resolved and cached before _offline removes the proxy settings, and the runs | ||
| # inside it use that cache only (--offline). | ||
| _test-offline-sqla version="min": |
There was a problem hiding this comment.
Self-review round one (implementation): FINDINGS, repaired
Base b2620f4b5ba52a23b809f5c5faebc646c0d04ddd, heads 50b16ef7 → 522df7f1030135dd619141265afd7e56de595b07. Passes: /code-review high and /simplify (reuse, simplification, efficiency, altitude).
Repaired (09f7b84e, 522df7f1):
- The inner
uv runcommand is a bash array, so the requirementsqlalchemy[asyncio]==Xis neither word-split nor globbed. - The runs inside
_offlineuse uv's cache only (--offline), because they start after the proxy settings are removed. The packages are resolved, anduv run --with ... truecaches them, before that. just test offline-sqlawithout an argument usesmin.- The
PYTHON_VERSIONSsync comment names this job's matrix and its setup-python condition. - The workflow comment and the testing guide state that the Release workflow requires the job.
docs/contributing.mddescribes the scope as the dialect tests that need no AWS plus collection. The testing guide's new block follows the offline target's scope paragraph.- Version resolution is one
casethat uses aresolvehelper.
Kept:
- The Release workflow requiring the job: a release should not go out while it is incompatible with the newest allowed SQLAlchemy.
- The repeated no-op
uv run truesyncs in_offline, which are cheap. [positional-arguments], whichjustneeds to pass*commandto the shebang script.- Separate setup steps per job, which follows the workflow's existing pattern.
Validation: just lint and just docs lint passed, and actionlint reported nothing. just test offline-sqla (2.0.52), latest and 2.1.9 each passed 734 tests and collected the suites. just test offline passed 4572 tests.
| # do not wait for this job, so a new SQLAlchemy release that breaks it does | ||
| # not stop the AWS suites of unrelated pull requests. The Release workflow | ||
| # requires it, as it requires every job of this workflow. | ||
| offline-sqla: |
There was a problem hiding this comment.
Self-review round two (claims, operations, evidence): CLEAN
Base b2620f4b5ba52a23b809f5c5faebc646c0d04ddd, head 522df7f1030135dd619141265afd7e56de595b07. Claims checked:
- "uv resolves
min/latestfrompyproject.toml":uv pip compile --resolution lowest-direct|highestgives 2.0.52 and 2.1.9, and the recipe prints them. - "Collection catches Decode float ARRAY elements and run the compliance suite on SQLAlchemy 2.1 #1569's import error": master before Decode float ARRAY elements and import the compliance suite on SQLAlchemy 2.1 (GH-1569) #1577 fails to collect on 2.1.9 with
ImportError: DeprecatedCompoundSelectTest(checked earlier in this session), and pytest exits non-zero, which fails the recipe underset -e. - AWS: the job runs offline with no credentials; the targeted live run of the tests that 2.1.9 adds was approved by the maintainer and cost about 80 cases per driver. Results are in the PR body.
NameDenormalizeTestis the only failure, and it is now skipped with its reason: 2 passed and 6 skipped on both drivers. - CI: no
needs:link to the AWS jobs, so a new SQLAlchemy release that breaks the job does not stop the AWS suites of unrelated PRs. Theminrow uses Python 3.11, the oldest supported version; the locally verified rows use 3.15.
…tion precisely (GH-1543) From the independent review: the recipe takes the version as a positional argument instead of interpolating it into the script; it unsets UV_NO_CACHE, since the runs inside _offline read the packages from uv's cache; collecting the compliance suites opens a DB-API connection without contacting AWS, so the docs say so; the workflow comment says the offline job covers the dialect tests on the locked version and the AWS suites the compliance suites; and the NameDenormalizeTest comment says Athena returns a core select's names as written and the names of SELECT * in lowercase. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| # resolved and cached before _offline removes the proxy settings, and the runs | ||
| # inside it use that cache only (--offline). | ||
| [positional-arguments] | ||
| _test-offline-sqla version="min": |
There was a problem hiding this comment.
Independent review (Codex codex exec -s read-only, session 01a22d20-10c1-7703-a253-f6025ef73df1) of b2620f4b..522df7f1: 5 findings, all fixed in 85f66fcf.
Codex ran both rows in a temporary clone with external networking off. Python 3.11 with 2.0.52 and Python 3.15 with 2.1.9 each passed 734 tests and collected 1360 and 1428 compliance cases, synchronous and async. A resolver failure and a pytest failure both propagated through _offline. It also confirmed the Release workflow's dependency on the job and the 2.0 hasattr guard.
- The
NameDenormalizeTestcomment said a core select maps by position. Withdriver_column_names=Trueit reads names too, and it passes on Athena because Athena returns a core select's names as its column list writes them. The comment now says so. - The version was interpolated into the bash script.
_test-offline-sqlanow takes it as a positional argument ($1). - With
UV_NO_CACHE=1, the--offlineruns could not find the package. The recipe unsets it;UV_NO_CACHE=1 just test offline-sqlanow passes 734. - Collection opens a DB-API connection, with no AWS call. The docs and the recipe comment say "without contacting AWS".
- The workflow comment said the offline job covers the locked version. It now says the offline job runs the dialect tests and the AWS suites run the compliance suites on it.
Follow-up running on 522df7f1..85f66fcf.
There was a problem hiding this comment.
Independent follow-ups (Codex codex exec -s read-only)
- Follow-up 1 (
522df7f1..85f66fcf, session01a22d2f-e6d5-7220-b3d5-22f4051027b6): findings 1, 4 and 5 resolved. Two new findings, both fixed inadda5d98:just testinterpolated{{args}}, so it now forwards positional arguments (a version with a space reaches uv as one value); and unsettingUV_NO_CACHEbroke a read-only cache. - Follow-up 2 (
85f66fcf..adda5d98, session01a22d3b-71ea-7592-a3f2-b8e99db70376): the temporary cache thatadda5d98gaveUV_NO_CACHEmisreadUV_NO_CACHE=falseand, withUV_LINK_MODE=symlink, deleted files the environment linked to. Rather than patching each configuration,48fd2b7bremoves the cache handling: the recipe needs uv's cache, and its comment says so. With the cache disabled, uv itself reports the missing package, which matches the repository rule of letting tools report misuse. This also resolves follow-up 1'sUV_NO_CACHEfinding. - Follow-up 3 (
adda5d98..48fd2b7b, session01a22d4b-a2b1-7d62-af18-366fdd8c6600): CLEAN. The default cache path passed on Python 3.11.18 with SQLAlchemy 2.0.52 (734 tests; 1360 compliance cases collected in each mode).
…ry (GH-1543) From the independent follow-up: `just test` passes its arguments to the target recipe as positional arguments, so a version reaches uv as one value; and when the caller disables uv's cache (UV_NO_CACHE), the offline-sqla recipe uses a temporary cache shared by its uv runs instead of the persistent one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replacing a disabled cache with a temporary one broke other configurations (UV_NO_CACHE=false, a symlinked environment). The recipe needs uv's cache, as its comment now says; with the cache disabled, uv reports that the package is not cached. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The job's purpose is to test each supported SQLAlchemy series, 2.0 and 2.1. "min" and "latest" tested the declared minimum and the newest release instead: once the lock moves to 2.1, the latest 2.0 release would go untested, and lowest-direct resolution also lowered boto3, fsspec, and the other direct dependencies. `just test offline-sqla SERIES` now runs the latest release of a series that the extras allow, and a full version still runs that version. Each series runs on the newest Python version for which its releases publish wheels (2.0 on 3.14, 2.1 on 3.15), and the matrix comment says why the versions differ. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| # for Python 3.15, where uv would build it from source. Move a series to | ||
| # a newer Python version once its releases publish wheels for it. | ||
| include: | ||
| - sqlalchemy: '2.0' |
There was a problem hiding this comment.
Maintainer-requested change and self-review (both perspectives): 48fd2b7b..26a9e278
The maintainer asked for the job to test the 2.0 and 2.1 series rather than the minimum and the latest release, and for 2.0 to use the newest Python version for which it publishes wheels, with a comment explaining why the Python versions differ.
- The recipe takes a series (
2.0) or a version (2.1.9). A series is resolved withuv pip compile --constraint <(echo "sqlalchemy>=2.0,<2.1")within the extras' range. The other dependencies stay locked;lowest-directused to lower them all. - Wheels on PyPI: SQLAlchemy 2.0.58 publishes up to cp314 and 2.1.9 up to cp315. So the matrix is 2.0 on Python 3.14 and 2.1 on 3.15. Only the 3.15 row needs
setup-python, as before. - The docs (
testing.md,contributing.md,AGENTS.md) and thejust testhelp describe the series. ThePYTHON_VERSIONSsync comment still applies, since the matrix uses 3.14 and 3.15. - Compatibility:
min/latestare removed from an unreleased recipe. The recipe now needs an argument, andjustreports the missing parameter.
Validation:
just lintandjust docs lint: passed.- With
UV_PYTHONand a temporaryUV_PROJECT_ENVIRONMENT, as in CI:just test offline-sqla 2.0on 3.14 (2.0.58): 734 passed; both compliance collections succeeded.just test offline-sqla 2.1on 3.15 (2.1.9): 734 passed; both compliance collections succeeded.
just test offline-sqla 2.1.9: 734 passed.
…H-1543) From the independent follow-up review: - `uv pip compile` gets `--resolution highest`, so a UV_RESOLUTION setting cannot resolve a series to an older release. - Both rows use setup-python: uv's Python 3.13+ cannot compile Python.h, which the 3.14 row may need too. - The matrix comment and the testing guide say "compiled wheels": SQLAlchemy 2.0 also publishes a pure-Python wheel, which Python 3.15 would install without the C extensions. - The testing guide shows the recipe's required argument. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| if [[ "$1" =~ ^([0-9]+)\.([0-9]+)$ ]]; then | ||
| series="sqlalchemy>=$1,<${BASH_REMATCH[1]}.$((BASH_REMATCH[2] + 1))" | ||
| version=$(uv pip compile pyproject.toml --extra sqlalchemy --extra aiosqlalchemy \ | ||
| --constraint <(echo "$series") --resolution highest \ |
There was a problem hiding this comment.
Independent follow-up 4 (Codex, 48fd2b7b..26a9e278): FINDINGS, repaired in 397f4fa2
- With
UV_RESOLUTION=lowest-direct,2.0resolved to 2.0.52.uv pip compilenow gets--resolution highest, and the same environment resolves 2.0.58. - The 3.14 row skipped
setup-python, which uv's Python 3.13+ needs to compilePython.h. Both rows now use it, and thePYTHON_VERSIONSsync comment no longer mentions a condition. - SQLAlchemy 2.0.58 also publishes
py3-none-any, so Python 3.15 would install the pure-Python wheel, not build from source. The matrix comment and the testing guide now say "compiled wheels". - The testing guide now shows the required argument (
just test offline-sqla <series-or-version>).
The reviewer also ran both series in isolation. Each passed 734 tests and collected both compliance suites, and the other packages matched the lock. 1.4 was rejected by the extras' bound.
Validation: just lint, just docs lint, and actionlint: passed.
From the independent follow-up review: the GitHub Actions section showed the recipe without its required argument. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
||
| The Test workflow runs for pull requests that change files other than `docs/` and Markdown. | ||
| It runs the offline checks (`just lint`, and `just test offline` on the newest supported Python version) on each of them, including Drafts and external forks. | ||
| It also runs `just test offline-sqla 2.0` and `just test offline-sqla 2.1`, for each supported SQLAlchemy series, each on the newest Python version for which that series publishes compiled wheels; the AWS suites do not wait for these, and the Release workflow requires them. |
There was a problem hiding this comment.
Independent follow-up 5 (Codex, session 01a22ee2-80f3-7a31-9330-571f29f26098, 26a9e278..397f4fa2): FINDINGS, repaired in 8d309389
The reviewer confirmed that three of the four follow-up 4 findings are resolved. UV_RESOLUTION=lowest still selects 2.0.58, both rows run setup-python, and the wheel comment is accurate.
Remaining: the GitHub Actions section of the testing guide showed just test offline-sqla without its required argument. It now shows just test offline-sqla 2.0 and just test offline-sqla 2.1. just docs lint: passed.
There was a problem hiding this comment.
Independent follow-up 6 (Codex, session 01a22ef0-b1e7-7601-942e-661dc222dbd2, 397f4fa2..8d309389): CLEAN. Both CI invocations in the testing guide now pass the series argument, matching the matrix.
WHAT
just test offline-sqla SERIES|VERSION. The recipe runs the SQLAlchemy tests that need no AWS (tests/pyathena/sqlalchemy/,tests/pyathena/aio/sqlalchemy/,-m "not aws") on another SQLAlchemy release. It also collects the compliance suites (tests/sqlalchemy/, synchronous and--dburi async); collecting imports them without connecting.2.0runs its latest release that thesqlalchemy/aiosqlalchemyextras allow. uv resolves it withuv pip compile --resolution highestand a>=2.0,<2.1constraint, sopyproject.tomlstays the only place that declares the allowed range. The other dependencies stay at their locked versions. A full version such as2.1.9runs that version.uv run --offline --no-sync --with "sqlalchemy[asyncio]==X", which changes neither the developer's.venvnoruv.lock. The packages are resolved and cached before the no-AWS environment removes the proxy settings. The recipe prints the SQLAlchemy version that it runs.just test offlinemoves unchanged into a shared_offlinerecipe that both targets use.just testpasses extra arguments to its target.offline-sqlajob in.github/workflows/test.yaml. It runs each supported series,2.0and2.1(fail-fast: false), for every event, as theofflinejob does.setup-python, because uv's Python 3.13+ cannot compilePython.h.offline.NameDenormalizeTest(new in 2.1) reads column names from the result; Athena returns them in lowercase, including quoted names (ALL_UPPERCASE→all_uppercase). Its driver-SQL and textual statements are skipped, and the core select, which maps columns by position, still runs.docs/testing.md(the offline section and GitHub Actions),docs/contributing.md(SQLAlchemy dialect changes) andAGENTS.mddescribe the new target.WHY
Closes #1543. CI tested SQLAlchemy only at the locked version, so the declared minimum and new releases broke unnoticed: #1542 (2.0.48), #1563 and #1569 (2.1). The design follows Claude Fable 5.2's proposal, consulted in parallel with Codex; the maintainer chose it over a version-pinned job with path filters. The maintainer then replaced the minimum/latest rows with one row per series, which keeps the latest 2.0 release tested after the lock moves to 2.1.
The maintainer decided to run once, against Athena, the compliance tests that SQLAlchemy 2.1.9 adds over the locked 2.0.58. Whether the compliance suites also run on these versions in CI stays out of this PR, because they need AWS.
TEST
Tested commit: 8d30938 (on b2620f4).
just lint,just docs lint: passed.actionlintontest.yaml: no findings.just test offline-sqla 2.0on Python 3.14 (SQLAlchemy 2.0.58) andjust test offline-sqla 2.1on Python 3.15 (2.1.9), withUV_PYTHONas in CI: 734 passed each; collection of the compliance suites (synchronous and async) succeeded.just test offline-sqla 2.1.9: 734 passed (6 warnings).just test offlineafter the refactor: 4572 passed.-konArgSignatureTest,TableDDLTest/FutureTableDDLTestif-(not-)exists,HasTableTest.test_has_multi_table*,NameDenormalizeTest,TableViaSelectTest,WindowFunctionTestrange/caching; 80 cases):NameDenormalizeTest(lowercase names, as above);--dburi async): the same, 47 passed, 27 skipped, 6 failed, allNameDenormalizeTest;NameDenormalizeTest2 passed, 6 skipped, on both.🤖 Generated with Claude Code