-
Notifications
You must be signed in to change notification settings - Fork 114
Backport CI and SQLAlchemy changes to 3.x for v3.37.0 #893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0fac8b1
7592993
311ce59
048498b
27331ec
5e86f01
e834e92
b43504f
2290413
29a4d0a
c521180
c4dfbbd
70a763d
91c922b
8340b4e
caaae8f
f0380bf
08645a1
3916345
e3ec1a9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,15 +2,30 @@ name: Test | |
|
|
||
| on: | ||
| pull_request: | ||
| # ready_for_review starts the AWS jobs for a pull request leaving Draft; | ||
| # converted_to_draft starts a run without them, which cancels an | ||
| # in-progress run through the concurrency group. paths-ignore applies to | ||
| # both, so a pull request that now changes only docs starts neither. | ||
| types: [opened, synchronize, reopened, ready_for_review, converted_to_draft] | ||
| paths-ignore: | ||
| - 'docs/**' | ||
| - '**.md' | ||
| # The scheduled run executes every suite, including the ones that pull | ||
| # requests only run when related files change, on the newest Python version. | ||
| schedule: | ||
| - cron: '0 0 * * 0' | ||
| # Allows refreshing the README status badge on demand: the badge reflects | ||
| # the latest run on the default branch, which is otherwise only the weekly | ||
| # scheduled run and stays red for up to a week after a transient failure. | ||
| # Runs every suite on the selected branch: on demand for a pull request, and | ||
| # to refresh the README status badge after a transient failure on the | ||
| # default branch. | ||
| workflow_dispatch: | ||
| inputs: | ||
| python-versions: | ||
| description: Comma-separated Python versions, such as 3.12 or 3.11,3.14; empty for every supported version | ||
| type: string | ||
| default: '' | ||
| # The Release workflow runs every suite on every supported Python version | ||
| # before publishing. | ||
| workflow_call: | ||
|
|
||
| permissions: | ||
| id-token: write | ||
|
|
@@ -23,19 +38,120 @@ concurrency: | |
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| # Offline checks run for every event, including Draft and fork pull requests. | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 | ||
| with: | ||
| python-version: '3.12' | ||
| enable-cache: true | ||
| - uses: taiki-e/install-action@7a79fe8c3a13344501c80d99cae481c1c9085912 # v2.81.10 | ||
| with: | ||
| tool: just | ||
| - run: just lint | ||
|
|
||
| # Selects the AWS suites and Python versions. Draft and external-fork pull | ||
| # requests run none. A ready pull request always runs the PyAthena suite; it | ||
| # runs the SQLAlchemy tests (the compliance suites and the PyAthena suite's | ||
| # SQLAlchemy tests) and the Spark tests only when their code, tests, | ||
| # dependencies, or this workflow change. Pull requests and the schedule test | ||
| # the newest Python version; a dispatch tests the requested versions or | ||
| # every version, and the Release workflow every version. | ||
| changes: | ||
| if: >- | ||
| github.event_name != 'pull_request' || | ||
| (!github.event.pull_request.draft && | ||
| github.event.pull_request.head.repo.full_name == github.repository) | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| pull-requests: read | ||
| outputs: | ||
| sqla: ${{ steps.filter.outputs.sqla }} | ||
| spark: ${{ steps.filter.outputs.spark }} | ||
| python-versions: ${{ steps.filter.outputs.python-versions }} | ||
| steps: | ||
| - id: filter | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| EVENT_NAME: ${{ github.event_name }} | ||
| REPO: ${{ github.repository }} | ||
| PR_NUMBER: ${{ github.event.pull_request.number }} | ||
| REQUESTED_VERSIONS: ${{ inputs.python-versions }} | ||
| # Every supported version, oldest first; keep in sync with the | ||
| # pyproject.toml classifiers. | ||
| PYTHON_VERSIONS: '["3.10", "3.11", "3.12", "3.13", "3.14"]' | ||
| run: | | ||
| case "$EVENT_NAME" in | ||
| pull_request | schedule) | ||
| versions=$(jq -c '[last]' <<< "$PYTHON_VERSIONS") | ||
| ;; | ||
| workflow_dispatch) | ||
| versions=$(jq -c --arg requested "$REQUESTED_VERSIONS" ' | ||
| ($requested | split(",") | map(gsub("\\s"; "")) | map(select(. != "")) | unique) as $selected | ||
| | if $selected == [] then . | ||
| elif ($selected - .) == [] then $selected | ||
| else error("unsupported Python versions: \($selected - . | join(", "))") | ||
| end' <<< "$PYTHON_VERSIONS") | ||
| ;; | ||
| *) | ||
| # The Release workflow (a workflow_call from a tag push). | ||
| versions=$(jq -c '.' <<< "$PYTHON_VERSIONS") | ||
| ;; | ||
| esac | ||
| echo "python-versions=$versions" >> "$GITHUB_OUTPUT" | ||
| if [[ "$EVENT_NAME" != "pull_request" ]]; then | ||
| { | ||
| echo "sqla=true" | ||
| echo "spark=true" | ||
| } >> "$GITHUB_OUTPUT" | ||
| exit 0 | ||
| fi | ||
| files=$(gh api "repos/$REPO/pulls/$PR_NUMBER/files" --paginate --jq '.[].filename') | ||
| printf 'Changed files:\n%s\n' "$files" | ||
| shared='^(\.github/workflows/test(-suite)?\.yaml|justfile|pyproject\.toml|uv\.lock)$' | ||
| sqla="$shared|^pyathena/(aio/)?sqlalchemy/|^tests/sqlalchemy/|^tests/pyathena/(aio/)?sqlalchemy/|^setup\.cfg$" | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Independent review, relayed. The reviewer was Codex CLI 0.157.1 ( Scope: 4ef4d3e..e3ec1a9 in a detached snapshot. The prompt gave the head, the source merge SHAs, and the scope; it did not include the PR number, PR body, commit messages, or earlier findings. Static review only: no tests, builds, GitHub access, or network. Covered: all 19 cherry-picks compared with their source merges, including the conflict resolutions; the 3.x-only SQLAlchemy 1.x change; affected cursors and dialect code; tests; docs; Actions workflows. Result: FINDINGS.
Verification and disposition:
|
||
| spark="$shared|^pyathena/(aio/)?spark/|^tests/pyathena/(aio/)?spark/" | ||
| if grep -qE "$sqla" <<< "$files"; then | ||
| echo "sqla=true" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "sqla=false" >> "$GITHUB_OUTPUT" | ||
| fi | ||
| if grep -qE "$spark" <<< "$files"; then | ||
| echo "spark=true" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "spark=false" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| # The three suites create their own schemas and tables, so they run in | ||
| # parallel; each is still a separate job for "Re-run failed jobs". | ||
| test: | ||
| needs: changes | ||
| uses: ./.github/workflows/test-suite.yaml | ||
| with: | ||
| test-type: pyathena | ||
| python-versions: ${{ needs.changes.outputs.python-versions }} | ||
| skip-spark: ${{ needs.changes.outputs.spark != 'true' }} | ||
| skip-sqla: ${{ needs.changes.outputs.sqla != 'true' }} | ||
|
|
||
| test-sqla: | ||
| needs: [test] | ||
| needs: changes | ||
| if: needs.changes.outputs.sqla == 'true' | ||
| uses: ./.github/workflows/test-suite.yaml | ||
| with: | ||
| test-type: sqla | ||
| python-versions: ${{ needs.changes.outputs.python-versions }} | ||
|
|
||
| test-sqla-async: | ||
| needs: [test-sqla] | ||
| needs: changes | ||
| if: needs.changes.outputs.sqla == 'true' | ||
| uses: ./.github/workflows/test-suite.yaml | ||
| with: | ||
| test-type: sqla_async | ||
| python-versions: ${{ needs.changes.outputs.python-versions }} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self-review round two (claims, callers, and operations), by the authoring model; not an independent review.
Scope: the same base and head as round one (4ef4d3e..e3ec1a9). This round covers the PR body, the commit messages, and the docs added to 3.x.
Result: FINDINGS. Two gaps in the PR body, both corrected; no code change.
benchmarks/uv.lockconflict. It is now listed.Claims checked:
arrayinischema_namesandtypes.ARRAYincolspecsmap toAthenaArray.CASTtoDoublerendersDOUBLE.docs/testing.mddescribes the repository's Test and Release workflows, and it holds for 3.x after this PR. The scheduled row applies to the default branch, because GitHub runs schedules only from there.Existing callers:
Operations:
docs-triggernow fires from the default branch's workflow after a successful Release. The tag's own copy no longer starts a docs build.