Skip to content

fix(validation): raise the declared sqlglot minimum to 30.29.0 - #793

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

christianeu-db merged 1 commit into
apache:mainfrom
403pagelabs:validation-sqlglot-minimum

Conversation

@403pagelabs

Copy link
Copy Markdown
Contributor

Summary

Raises the sqlglot minimum that validation/validate.py declares from 30.19.0 to 30.29.0, the oldest release the test suite passes on.

On main (83d39d6) at the declared minimum:

uv run --no-project --with pytest --with pyyaml --with jsonschema --with "sqlglot==30.19.0" -m pytest validation/tests/
FAILED test_rejects_a_dialect_sql_statement_used_as_an_expression[snowflake-list]
FAILED test_accepts_keyword_column_expressions_in_dialect[desc-dot-bigquery]
2 failed, 974 passed, 1 skipped
  • snowflake-list expects LIST @stage to be rejected as a LIST STAGE statement. sqlglot parses it that way from 30.22.0.
  • desc-dot-bigquery expects desc.x to be accepted in BigQuery. sqlglot accepts it from 30.29.0 (there is no 30.28.0).

What changes:

  • The script headers of validation/validate.py and validation/test_validate.py declare sqlglot>=30.29.0.
  • SQLGLOT_MIN_VERSION, added in fix(validation): degrade gracefully on sqlglot older than 30.19.0 #780, moves to 30.29.0 with them, so the warning for a sqlglot that is too old advises the declared minimum. The guard still keys on exp.Agg, which sqlglot ships from 30.19.0, so a release between the two is checked as before.
  • A new test reads both headers and fails when either differs from SQLGLOT_MIN_VERSION.

With the change:

sqlglot validation/tests/
30.27.0 1 failed (desc-dot-bigquery), 977 passed, 1 skipped
30.29.0 978 passed, 1 skipped
30.33.0 (latest) 978 passed, 1 skipped

uv run validation/test_validate.py passes its 59 tests on the new header.

ost/pyproject.toml already declares sqlglot>=30.29.0, so the two packages now agree.

On the CI question in #767, the workflow installs the latest sqlglot and so cannot see a drift like this one. I left it alone here. A second pytest step with --with "sqlglot==30.29.0" would run the declared minimum. I can add it to this pull request or open a follow-up, whichever you prefer.

Related Issues

Closes #767

Checklist

Validation

  • New validation cases are covered by tests

Tests

  • All existing tests pass (pytest / CI green)
  • New functionality is covered by tests

Compliance

  • New third-party dependencies follow Third-Party Dependencies (no new dependency, the minimum of an existing one moves)

Two tests fail on sqlglot 30.19.0, the minimum validate.py declared.
`snowflake-list` needs 30.22.0, where `LIST @stage` parses as a LIST STAGE
statement. `desc-dot-bigquery` needs 30.29.0, where BigQuery accepts
`desc.x`. The suite passes from 30.29.0.

The script headers of validate.py and test_validate.py now declare
`sqlglot>=30.29.0`. SQLGLOT_MIN_VERSION moves with them, so the warning for
a sqlglot that is too old advises the same version. A test fails when either
header differs from the constant. The guard still keys on exp.Agg, which
sqlglot ships from 30.19.0.

Closes apache#767

@christianeu-db christianeu-db left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks @403pagelabs! A follow-up PR for the CI step that runs the declared minimum would be welcome.

@christianeu-db
christianeu-db merged commit 6925496 into apache:main Nov 23, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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