Skip to content

Commit c85c09f

Browse files
ci: extend sqlglot syntax check to mimic-iii concepts
Parse mimic-iii/concepts in PR checks alongside mimic-iv/concepts. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 3a914fc commit c85c09f

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

.github/scripts/check_sql_syntax.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"""Validate that every BigQuery concept SQL file parses with sqlglot.
33
44
Usage: ``python .github/scripts/check_sql_syntax.py [ROOT ...]``
5-
(defaults to ``mimic-iv/concepts``). Exits non-zero if any file fails to parse.
5+
(defaults to ``mimic-iv/concepts`` and ``mimic-iii/concepts``).
6+
Exits non-zero if any file fails to parse.
67
"""
78
from __future__ import annotations
89

@@ -14,7 +15,10 @@
1415

1516

1617
def main(argv: list[str]) -> int:
17-
roots = [Path(p) for p in argv[1:]] or [Path("mimic-iv/concepts")]
18+
roots = [Path(p) for p in argv[1:]] or [
19+
Path("mimic-iv/concepts"),
20+
Path("mimic-iii/concepts"),
21+
]
1822
files = sorted({f for root in roots for f in root.rglob("*.sql")})
1923
if not files:
2024
print(f"::error::No .sql files found under: {', '.join(map(str, roots))}")

.github/workflows/sql_syntax_check.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
pull_request:
55
paths:
66
- 'mimic-iv/concepts/**'
7+
- 'mimic-iii/concepts/**'
78
- 'src/mimic_utils/**'
89
- '.github/scripts/check_sql_syntax.py'
910
- '.github/workflows/sql_syntax_check.yml'
@@ -24,4 +25,4 @@ jobs:
2425
- name: Install package
2526
run: pip install -e . --no-deps
2627
- name: Parse concept SQL with sqlglot
27-
run: python .github/scripts/check_sql_syntax.py mimic-iv/concepts
28+
run: python .github/scripts/check_sql_syntax.py mimic-iv/concepts mimic-iii/concepts

0 commit comments

Comments
 (0)