Skip to content

Backport #906: Run SQLAlchemy and Spark tests when shared core modules change - #910

Merged
laughingman7743 merged 1 commit into
3.xfrom
backport/3.x-896
Oct 1, 2026
Merged

laughingman7743 merged 1 commit into
3.xfrom
backport/3.x-896

Conversation

@laughingman7743

@laughingman7743 laughingman7743 commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

WHAT

Backport #906 to the 3.x maintenance branch. It is one -x commit, cherry-picked from master's merge commit 9b9421d (git cherry-pick -m 1 -x).

  • The Test workflow's changes job also selects the SQLAlchemy tests (the compliance suites and tests/pyathena/(aio/)sqlalchemy/) and the Spark tests when a ready pull request changes:
    • a top-level module of pyathena or pyathena.aio (pyathena/*.py, pyathena/aio/*.py), or
    • a shared test fixture: tests/__init__.py, tests/pyathena/__init__.py, tests/pyathena/aio/__init__.py, tests/pyathena/conftest.py, tests/pyathena/aio/conftest.py, tests/pyathena/tables.py, tests/pyathena/util.py, or tests/resources/.
  • Changes limited to other subpackages (pyathena/filesystem/, the result-set packages) and their tests still skip both.
  • The selection uses dorny/paths-filter v4.0.3, pinned to ceb8a2b8, instead of gh api and grep -E. The action receives only the job's pull-requests: read token.
  • Schedule, dispatch, and Release runs still select every suite. The Python version selection, including 3.x's 3.10, is unchanged.

The merge commit applies without conflicts, and its added and removed lines match #906 exactly. After this change, 3.x's test.yaml differs from master's only in the 3.x-specific lines: no license header (#805 is master-only), and PYTHON_VERSIONS includes 3.10 (#864 is master-only). 3.x has no tests/pyathena/tables.py (master added it in #874), so that pattern matches nothing here; it is kept to stay identical to master.

WHY

#896 asked for this fix on master first, then on 3.x, whose workflow matched master's after #893. #906 closed it on master. On 3.x the gap is the same: the SQLAlchemy and Spark packages import the same top-level modules (pyathena, common, error, formatter, model, util, aio.connection, aio.util), and their tests use the same fixtures (tests, tests.pyathena.conftest, tests.pyathena.aio.conftest, tests.pyathena.util). Yet a pull request that changes only those files skips both suites.

Release: CI only, no release-note entry.

TEST

Tested commit: 056da1a.

  • just lint (license headers, ruff, mypy, cfn-lint): clean. actionlint .github/workflows/test.yaml and pinact run --check: clean. 3.x has no just scripts recipe.
  • Local simulation of the action's matching, the same as for ci: run SQLAlchemy and Spark tests when shared core modules change #906. A throwaway script loads the filters block from this branch's workflow with js-yaml 4 and matches with picomatch 2.3.1, dot: true.
  • AWS: Ready run 36797274717 (Python 3.14). This PR changes test.yaml, so every suite was selected; it is the first run of the action on 3.x.
    • The action called listFiles(pull_number: 910) and received [modified] .github/workflows/test.yaml.
    • It reported shared = true, core = false, sqla = true, spark = true.
    • test, test-sqla, and test-sqla-async passed.

🤖 Generated with Claude Code

…s change

The Test workflow's changes job now also selects the SQLAlchemy and Spark
tests when a pull request changes a top-level module of pyathena or
pyathena.aio, or a shared test fixture (the tests and tests/pyathena(/aio)
package initializers and conftest files, tests/pyathena/tables.py,
tests/pyathena/util.py, tests/resources/). Changes limited to other
subpackages still skip them. The selection now uses dorny/paths-filter
v4.0.3 (SHA-pinned) instead of gh api and grep; other events still run
every suite.

(cherry picked from commit 9b9421d)

The merge commit applies cleanly; the added and removed lines match #906
exactly. 3.x has no tests/pyathena/tables.py, so that pattern matches
nothing there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- id: filter
- id: paths
if: github.event_name == 'pull_request'
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3

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 one (backport behavior): CLEAN

sqla: ${{ steps.filter.outputs.sqla }}
spark: ${{ steps.filter.outputs.spark }}
python-versions: ${{ steps.filter.outputs.python-versions }}
sqla: ${{ github.event_name != 'pull_request' || steps.paths.outputs.sqla == 'true' }}

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 two (backport claims and operations): FINDINGS, repaired in the PR body

  • Scope: claims in the commit message and PR body of ac8b11ee2dd80576f9359efacbe80a3ee344c5d2..056da1af8a856d97746f5119c15b51916e97cc14.
  • Finding (repaired): the PR body said tests/pyathena/tables.py "came with master's fixture work". git log --diff-filter=A shows it was added by 12cfd65, merged in Define the shared test tables in Python and generate their data #874; the body now names Define the shared test tables in Python and generate their data #874. The pattern stays to keep the commit identical to master and matches nothing on 3.x.
  • Claims checked:
    • "applies without conflicts, lines match ci: run SQLAlchemy and Spark tests when shared core modules change #906 exactly": the line-by-line comparison above.
    • "differs from master's only in the 3.x-specific lines": git diff origin/master HEAD -- .github/workflows/test.yaml shows only the header and 3.10.
    • The 3.x import list in WHY: grep over 3.x's pyathena/(aio/)?(sqlalchemy|spark)/. 3.x does not import pyathena.cursor, converter, or aio.cursor there, and the body does not claim it.
    • "CI only, no release-note entry": only .github/workflows/test.yaml changes.
  • Operations: the action's first run on 3.x is this PR's Ready run. That run selects every suite, because test.yaml changes. The AWS cost effect on later 3.x pull requests follows ci: run SQLAlchemy and Spark tests when shared core modules change #906, and 3.x pull requests are few.
  • Evidence limits: the simulation is local, and AWS results come from the Ready run, which has not run yet.

- id: filter
- id: paths
if: github.event_name == 'pull_request'
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3

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): CLEAN

  • Reviewer: Codex CLI 0.157.1, model gpt-6-sol, reasoning effort high, --sandbox read-only, --ephemeral, session 01a0f4dd-4ffe-7372-9a8d-3eda092b8d9b. Static review only.
  • Scope: ac8b11ee2dd80576f9359efacbe80a3ee344c5d2..056da1af8a856d97746f5119c15b51916e97cc14 on a detached snapshot, compared with master's merge commit 9b9421d. The package also contained the pinned paths-filter source (ceb8a2b8, v4.0.3), outside the tree. The prompt omitted the PR number, description, and prior findings. The snapshot's HEAD was unchanged afterwards; the only untracked entry was that reference directory.
  • Result:
    • The added and removed lines match master's change; only the line numbers differ.
    • 3.x's Python list still includes 3.10.
    • No 3.x-only dependency outside the intentionally excluded subpackages is missed.
    • The outputs follow the matched paths for ready same-repository PRs. Schedule, dispatch, and the Release workflow_call select both suites. 3.x's test-suite.yaml inputs remain compatible.
    • The action is SHA-pinned with pull-request read permission, and a filter or API failure fails changes.
  • Pre-existing note (deferred): paths-ignore also applies to converted_to_draft. A PR reduced to docs-only changes that is converted to Draft starts no replacement run, so an earlier active run is not cancelled. The behavior predates this commit and is documented in the comment above on: ("paths-ignore applies to both, so a pull request that now changes only docs starts neither").

@laughingman7743
laughingman7743 marked this pull request as ready for review October 1, 2026 00:39
@laughingman7743
laughingman7743 merged commit 0397685 into 3.x Oct 1, 2026
11 checks passed
@laughingman7743
laughingman7743 deleted the backport/3.x-896 branch October 1, 2026 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant