Skip to content

ci(validation): run the tests on the declared sqlglot minimum - #807

Merged
jbonofre merged 1 commit into
apache:mainfrom
403pagelabs:validation-ci-sqlglot-minimum
Nov 23, 2026
Merged

jbonofre merged 1 commit into
apache:mainfrom
403pagelabs:validation-ci-sqlglot-minimum

Conversation

@403pagelabs

Copy link
Copy Markdown
Contributor

Summary

Adds a step to Validation CI that runs the validation tests on the sqlglot minimum the script headers declare. This is the follow-up asked for in the review of #793.

The workflow installs the latest sqlglot, so a test that needs a newer release than the headers declare still passes there. #767 was that case: two tests failed on 30.19.0, the minimum declared at the time, while CI was green.

- name: Run validation tests on the declared sqlglot minimum
  run: |
    minimum=$(sed -n 's/^# *"sqlglot>=\([0-9.]*\)",$/\1/p' validation/validate.py)
    uv run --with "sqlglot==$minimum" validation/test_validate.py
    uv run --with pytest --with pyyaml --with jsonschema --with "sqlglot==$minimum" -m pytest validation/tests/
  • The step reads the version from the header of validation/validate.py. The test added in fix(validation): raise the declared sqlglot minimum to 30.29.0 #793 holds both headers equal to SQLGLOT_MIN_VERSION, so the step follows the next change to any of the three.
  • --with "sqlglot==X" beside a header that says sqlglot>=X resolves to X, so validation/test_validate.py runs on the minimum too.
  • If the header line changes shape and sed finds nothing, uv stops with Failed to parse: `sqlglot==` and the step fails.
  • The step runs in each cell of the Python matrix. Locally the two test runs took 4.5 and 2.6 seconds.

The step's script, run locally with bash -e on main at 4a315fa:

sqlglot validation/test_validate.py validation/tests/
30.29.0, read from the header 59 tests, OK 1028 passed, 1 skipped
30.27.0, set by hand not run 1 failed (desc-dot-bigquery), 1027 passed, 1 skipped

The first row is the same on Python 3.11 and 3.14. The second row is what the step reports when a test needs a newer sqlglot than the one it installs.

Related Issues

Follow-up to #793, which closed #767.

Checklist

Tests

  • All existing tests pass (pytest / CI green)

Validation CI installs the latest sqlglot, so it cannot see a test that needs
a newer release than the script headers declare. apache#767 was that drift: two
tests failed on 30.19.0, the minimum declared then, while CI stayed green.

A new step reads the minimum from the validate.py header and runs
validation/test_validate.py and validation/tests/ with sqlglot pinned to it.
The header is the one place the version is written, so the step follows the
next change to it.
@github-actions github-actions Bot added the infra label Nov 23, 2026
@jbonofre
jbonofre self-requested a review November 23, 2026 15:58

@jbonofre jbonofre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks @403pagelabs!

@jbonofre
jbonofre merged commit 0921916 into apache:main Nov 23, 2026
9 checks passed
@403pagelabs
403pagelabs deleted the validation-ci-sqlglot-minimum branch November 23, 2026 20:37
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.

validation: two tests fail on sqlglot 30.19.0, the declared minimum

2 participants