Run the PyAthena suite only when its files change - #913
Merged
Merged
Conversation
Add a pyathena output to the changes job, an allowlist of the package, the tests, setup.cfg, and the shared build files, and run the test job only when it is true. It is a superset of the sqla and spark filters, so their tests never run without the PyAthena suite. Events other than pull_request still run every suite. The trigger keeps paths-ignore, so the lint job still runs for pull requests that change only benchmarks, scripts, or CloudFormation templates. Update docs/testing.md for this and for the shared core paths that #906 added to the SQLAlchemy and Spark selection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
laughingman7743
commented
Oct 1, 2026
| # parallel; each is still a separate job for "Re-run failed jobs". | ||
| test: | ||
| needs: changes | ||
| if: needs.changes.outputs.pyathena == 'true' |
Member
Author
There was a problem hiding this comment.
Self-review round one (implementation behavior): FINDINGS, repaired
- Scope: full pass over
git diff 468affc6417840912fd58b37712214c3a493edc3..2c369bf670a43bb65a36c26fbe38c1fb29d082e8, two files:.github/workflows/test.yaml(newpyathenafilter,pyathenajob output,if:ontest,changescomment) anddocs/testing.md(GitHub Actions section). - Behavior:
- The output has the same form as
sqla/spark, so it is the stringtrue/false. For non-pull_requestevents thepathsstep is skipped and the output istrue, so schedule, dispatch, and Release runs still select the suite. Inside theworkflow_callfromrelease.yaml,github.event_nameis the caller's tagpush, andrelease(needs: test) still waits on every suite. - Draft and fork PRs:
changesis skipped, sotestis skipped as before. Afalseoutput now skipstesttoo;test-sqla/test-sqla-asyncdo not depend ontest, and master has no required status checks, so a skipped job blocks nothing. - dorny v4.0.3 sets
<key>,<key>_count, andchangesoutputs per filter key (main.tslines 273-285);pyathenacollides with none of them. The comment lines insidefiltersparse as YAML comments, as in ci: run SQLAlchemy and Spark tests when shared core modules change #906. skip-spark/skip-sqlainputs are unchanged. Whentestruns, they behave as before.
- The output has the same form as
- Superset:
pyathena=shared+setup.cfg+pyathena/**+tests/**, which covers everycore,sqla, andsparkpattern. The simulation's invariant over all tracked files on master (279) and 3.x (236) holds. - What the suite reads:
just tox(tox config inpyproject.toml) →uv sync --group dev(uv.lock) +just test pyathena(justfile, lint first) overtests/pyathena/. Thebenchmarksworkspace member reaches it only throughuv.lock. No test readsscripts/,cloudformation/, orbenchmarks/(grep). - Finding (repaired in dfc14e2):
docs/testing.mdstill said marking the Draft ready "starts the AWS jobs". With this change it may start none, so the sentence now says "the selected AWS jobs". - Simplicity: no
*coreinpyathena, becausepyathena/**andtests/**already contain it. - Checks after the repair:
just docs lintpasses; earlierjust lintandactionlintpass.
laughingman7743
commented
Oct 1, 2026
| # A superset of sqla and spark, so their tests never run without | ||
| # the PyAthena suite. | ||
| pyathena: | ||
| - *shared |
Member
Author
There was a problem hiding this comment.
Self-review round two (claims and operational effects): FINDINGS, repaired in the PR description
- Scope: full claim audit of
git diff 468affc6417840912fd58b37712214c3a493edc3..dfc14e24ae3003a4418aa90b3bed2c607ea0027c(workflow comments,docs/testing.md, both commit messages, the PR body) and the issue premises it repeats. - Finding (repaired in the PR body): it said Sweep leaked test databases daily with a one-day cutoff #907 merged after CI runs the PyAthena suite for pull requests that change no file it uses #911 was filed. Sweep leaked test databases daily with a one-day cutoff #907 merged at 2026-10-01T00:02:34Z, and CI runs the PyAthena suite for pull requests that change no file it uses #911 was created at 00:31:36Z. The body now says Sweep leaked test databases daily with a one-day cutoff #907 merged shortly before the issue and is missing from its list.
- Claims checked:
lintstill runs for PRs that change onlybenchmarks/,scripts/, orcloudformation/: the trigger'spaths-ignoreis unchanged (docs/**,**.md) andlinthas noif.- Sweep leaked test databases daily with a one-day cutoff #907's script and tests are covered elsewhere:
scripts.yamltriggers onscripts/**and.github/workflows/**and runsjust scripts, which runspytest scripts/tests/. - Replay:
gh pr list --search merged:>=2026-06-01returns 104 PRs. The six docs/Markdown-only ones (Add a security policy #748, Add shared instructions for Codex and Claude Code #749, Pin the CI test badge to the master branch #766, Add shared development and review skills for Codex and Claude Code #778, Define contribution, AWS validation, and attribution requirements #788, Fix PandasCursor performance tuning examples #902) start no run. Of the other 98, exactly Update gh-action-pypi-publish to v1.14.2 for metadata 2.5 support #765, Add NOTICE acknowledging PyHive's influence #802, Run benchmark jobs on a fleet of identical hosts #823, Count initialization row validation as API-heavy fleet work #824, Allow Graviton benchmark hosts with an architecture parameter #827, and Sweep leaked test databases daily with a one-day cutoff #907 change selection, each from the PyAthena suite alone to no AWS suite. - "Their tests never run without the PyAthena suite" (filter comment):
sqla/sparktrue impliespyathenatrue for every tracked file (simulation invariant), and for a PR's file set because each filter is an any-match. - Docs: the table row, the PyAthena related files, and "run all three" match the filters, including the
corepaths that ci: run SQLAlchemy and Spark tests when shared core modules change #906 added. The comment's short list ("the dependencies, or this workflow") follows the existing SQLAlchemy/Spark sentence; the exact list is thefiltersblock below it and the docs. Deferred as wording, not behavior. - "Once Ready its own run selects every suite": the PR changes
.github/workflows/test.yaml, which is inshared.
- Operator: fewer AWS runs only. A file missing from the allowlist is still tested by the weekly schedule and the Release workflow, whose
pyathenaoutput is alwaystrue. - Evidence limits: selection is checked by a local re-implementation of dorny v4.0.3 matching, not by GitHub. The PR's own run selects every suite, so no live
pyathena=falserun exists until a later PR that changes only unlisted files.
…te runs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
laughingman7743
commented
Oct 1, 2026
| The Spark tests are the PyAthena suite's `tests/pyathena/spark/` and `tests/pyathena/aio/spark/`. | ||
| When the SQLAlchemy or Spark tests do not run, the PyAthena suite runs without them. | ||
| For the SQLAlchemy tests, the related files are `pyathena/sqlalchemy/`, `pyathena/aio/sqlalchemy/`, `tests/sqlalchemy/`, their PyAthena suite test directories, and `setup.cfg`. | ||
| When the PyAthena suite runs but the SQLAlchemy or Spark tests do not, it runs without them. |
Member
Author
There was a problem hiding this comment.
Independent review (relayed): FINDINGS, repaired in e737245
- Reviewer: Codex CLI 0.157.1, model
gpt-6-sol, reasoning effort high,--sandbox read-only,--ephemeral, session01a0f50c-0ba1-7f92-982e-a63e640c8436. Static review only: no workflow or tests run. - Scope: full pass over
468affc6417840912fd58b37712214c3a493edc3..dfc14e24ae3003a4418aa90b3bed2c607ea0027con a detached snapshot. Because the sandbox has no network, the package also containedaction.yml,src/main.ts, andsrc/filter.tsof dorny/paths-filter at the pinned commitceb8a2b8(v4.0.3), outside the repository tree. The prompt omitted the PR number, description, commit messages, and prior findings. The snapshot's HEAD was unchanged afterwards; the only untracked entry was that reference directory. - Covered: the Test and Release workflow gates, the pinned action's parser and matching, the reusable suite, the test commands and fixtures, and
docs/testing.md. - Finding (introduced, verified, repaired):
docs/testing.md:165said "When the SQLAlchemy or Spark tests do not run, the PyAthena suite runs without them." For a Ready PR that changes onlyscripts/check_license_headers.py, the run starts andlintruns, but all three AWS suites are skipped, so the sentence implied a PyAthena run that does not happen. It now reads "When the PyAthena suite runs but the SQLAlchemy or Spark tests do not, it runs without them." - Otherwise: the
pyathenafilter matches the specified paths and is a superset ofsqlaandspark. The output and theif:keep schedule, dispatch, and Release runs, and a skipped or failedchangesdoes not starttest. The reviewer found no other introduced or pre-existing issue in scope.
| The Spark tests are the PyAthena suite's `tests/pyathena/spark/` and `tests/pyathena/aio/spark/`. | ||
| When the SQLAlchemy or Spark tests do not run, the PyAthena suite runs without them. | ||
| For the SQLAlchemy tests, the related files are `pyathena/sqlalchemy/`, `pyathena/aio/sqlalchemy/`, `tests/sqlalchemy/`, their PyAthena suite test directories, and `setup.cfg`. | ||
| When the PyAthena suite runs but the SQLAlchemy or Spark tests do not, it runs without them. |
Member
Author
There was a problem hiding this comment.
Repair self-review (both perspectives): CLEAN
- Scope:
git diff dfc14e24ae3003a4418aa90b3bed2c607ea0027c..e737245e6ecabe1f77660e19ff6153d906933c28, one sentence ofdocs/testing.md. - Behavior: documentation only; no workflow change.
- Claim: when
testruns withskip-sqla/skip-sparktrue,test-suite.yamladds--ignorefor those test directories toPYTEST_ADDOPTS, so "it runs without them" holds. - Related prose: a search of
docs/,README.md,CONTRIBUTING.md,AGENTS.md,.agents/, and.github/finds no other statement that the PyAthena suite always runs. Line 170 was already scoped to "the selected AWS jobs" in round one. - Check:
just docs lintpasses.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
laughingman7743
commented
Oct 1, 2026
| Changes to `pyproject.toml`, `uv.lock`, `justfile`, or the Test workflows run both. | ||
| For a pull request from a branch of this repository that still changes files other than `docs/` and Markdown, marking the Draft ready for review starts the AWS jobs, and converting it back to Draft cancels AWS jobs still running. | ||
| Changes to the modules directly under `pyathena/` and `pyathena/aio/`, the shared test fixtures such as `tests/pyathena/conftest.py` and `tests/resources/`, `pyproject.toml`, `uv.lock`, `justfile`, or the Test workflows run all three. | ||
| For a pull request from a branch of this repository that still changes files other than `docs/` and Markdown, marking the Draft ready for review starts any AWS jobs its changed files select, and converting it back to Draft cancels AWS jobs still running. |
Member
Author
There was a problem hiding this comment.
Independent follow-up 1 (relayed): FINDINGS, repaired in 692d623
- Reviewer: Codex CLI 0.157.1,
gpt-6-sol, effort high, read-only, ephemeral, session01a0f50c-...→ follow-up session01a0f50e-b944-7bd0-a43e-507edcd7a0e8. Static review of the repairdfc14e24..e737245eand the GitHub Actions section ofdocs/testing.md, againsttest.yamlandtest-suite.yaml. - Result: the repair at line 165 resolves the earlier finding and is accurate.
- New finding (verified, repaired): line 170 said marking the Draft ready "starts the selected AWS jobs". A Ready PR that changes only
scripts/check_license_headers.pystarts none. It now says "starts any AWS jobs its changed files select".
| Changes to `pyproject.toml`, `uv.lock`, `justfile`, or the Test workflows run both. | ||
| For a pull request from a branch of this repository that still changes files other than `docs/` and Markdown, marking the Draft ready for review starts the AWS jobs, and converting it back to Draft cancels AWS jobs still running. | ||
| Changes to the modules directly under `pyathena/` and `pyathena/aio/`, the shared test fixtures such as `tests/pyathena/conftest.py` and `tests/resources/`, `pyproject.toml`, `uv.lock`, `justfile`, or the Test workflows run all three. | ||
| For a pull request from a branch of this repository that still changes files other than `docs/` and Markdown, marking the Draft ready for review starts any AWS jobs its changed files select, and converting it back to Draft cancels AWS jobs still running. |
Member
Author
There was a problem hiding this comment.
Repair self-review (both perspectives) and independent follow-up 2 (relayed): CLEAN
- Self-review of
e737245e6ecabe1f77660e19ff6153d906933c28..692d623dc57bc9ef4d1a03021e8eab686dc06752(one sentence): documentation only. "Any" covers both outcomes: a PR that changes only unlisted files starts no AWS job, and one that changes listed files starts the selected suites. The cancellation half of the sentence is unchanged.just docs lintpasses. - Codex follow-up 2: same reviewer settings, session
01a0f50f-92d8-7563-ac95-db3c7e567b6e, static review of the repair anddocs/testing.md:150-190againsttest.yamlandtest-suite.yaml. Result: CLEAN. The reported case now selects no AWS jobs, and the section is consistent. - After each run, the snapshot's HEAD matched the reviewed commit; its only untracked entry was the reference directory.
laughingman7743
marked this pull request as ready for review
October 1, 2026 01:27
This was referenced Oct 1, 2026
laughingman7743
added a commit
that referenced
this pull request
Oct 1, 2026
Backport #913: Run the PyAthena suite only when its files change
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WHAT
pyathenafilter to thechangesjob in.github/workflows/test.yaml: the shared files (test.yaml,test-suite.yaml,justfile,pyproject.toml,uv.lock),setup.cfg,pyathena/**, andtests/**.pyathenajob output, in the same form assqlaandspark:truefor every event other thanpull_request.testjob (the PyAthena suite) only when that output istrue.pyathenafilter is a superset ofsqlaandspark, so the SQLAlchemy and Spark tests are never selected without the PyAthena suite.paths-ignore. Thelintjob (just lint: ruff, mypy, license headers, cfn-lint) still runs for pull requests that change onlybenchmarks/,scripts/, orcloudformation/.docs/testing.md: the Ready pull request row now says the PyAthena suite runs when related files change, and lists its related files. The SQLAlchemy and Spark text now names the top-level modules and shared test fixtures that ci: run SQLAlchemy and Spark tests when shared core modules change #906 added to their selection, which the page did not mention.WHY
Part of #911. The 3.x backport follows separately, and the issue stays open until it merges.
A Ready pull request that changes only files the PyAthena suite does not use still ran the suite against AWS.
TEST
Tested commit: 2c369bf for the workflow. The later commits up to 692d623 change only sentences of
docs/testing.md, andjust docs lintpasses.filtersblock, flattened anchors, picomatchdot: true,somequantifier):pyathena/**,tests/**,setup.cfg, and the shared files select the PyAthena suite.benchmarks/**,scripts/**,cloudformation/**,NOTICE,LICENSE,.mise.toml,.github/workflows/release.yaml, and.github/workflows/benchmarks.yamldo not.origin/3.x(236): no file selected bysqlaorsparkis unselected bypyathena.release.yaml), Add NOTICE acknowledging PyHive's influence #802 (NOTICE), Run benchmark jobs on a fleet of identical hosts #823, Count initialization row validation as API-heavy fleet work #824, Allow Graviton benchmark hosts with an architecture parameter #827 (benchmarks/), as listed in the issue.database-sweep.yaml,scripts/sweep_databases.pyand its tests,docs/testing.md), merged on 2026-10-01 shortly before the issue was filed and missing from its list. Its script and tests run in the separate Scripts workflow (just scripts).just lint,actionlint .github/workflows/test.yaml,just docs lint: pass.test.yaml, so its Ready run 36801176633 on 692d623 selected every suite. Thechangeslog showsFilter pyathena = trueandChanges output set to ["shared","sqla","spark","pyathena"];test,test-sqla, andtest-sqla-async(Python 3.14) passed. No live run withpyathena=falseexists yet; that case is covered only by the simulation.🤖 Generated with Claude Code