Skip to content

Commit 78ec304

Browse files
authored
Use sqlglot to properly check SQL delta files (#19224)
Rather than using dodgy regexes which keep breaking. Also fixes a regression where it looks like we didn't fail CI if the delta was in the wrong place.
1 parent 566670c commit 78ec304

File tree

5 files changed

+131
-82
lines changed

5 files changed

+131
-82
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ jobs:
110110
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
111111
with:
112112
python-version: "3.x"
113-
- run: "pip install 'click==8.1.1' 'GitPython>=3.1.20'"
113+
- run: "pip install 'click==8.1.1' 'GitPython>=3.1.20' 'sqlglot>=28.0.0'"
114114
- run: scripts-dev/check_schema_delta.py --force-colors
115115

116116
check-lockfile:

changelog.d/19224.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve robustness of the SQL schema linting in CI.

poetry.lock

Lines changed: 39 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,9 @@ towncrier = ">=18.6.0rc1"
370370
# Used for checking the Poetry lockfile
371371
tomli = ">=1.2.3"
372372

373+
# Used for checking the schema delta files
374+
sqlglot = ">=28.0.0"
375+
373376

374377
[build-system]
375378
# The upper bounds here are defensive, intended to prevent situations like

0 commit comments

Comments
 (0)