Conversation
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Pull request overview
Updates the validator so warning vs error severity is determined by an explicit warning type rather than by user-controlled message text, preventing false “PASSED” results when inputs contain Warning:.
Changes:
- Introduce a
ValidationWarningstring subtype and classify diagnostics by type instead of message content. - Convert existing warning-producing paths (reference key-coverage, missing-sqlglot) to emit
ValidationWarning. - Add regression tests for warning-like names/text and update CI to install
sqlglotso SQL validation tests run.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| validation/validate.py | Adds ValidationWarning and updates warning/error classification to be type-based. |
| validation/tests/test_validate.py | Adds regression tests and a helper fixture to exercise CLI exit codes/output. |
| .github/workflows/validation-ci.yml | Installs sqlglot in the pytest job to run SQL validation regressions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
kayemkim
left a comment
There was a problem hiding this comment.
Ran this locally against a merge with current main (28365cd) on Python 3.11 through 3.14, following the steps in validation-ci.yml: the duplicate-key tests, the pytest suite with sqlglot, and the canonical example. All green, and the sqlglot test executed on every version rather than being skipped.
I also reproduced the bug on main. A relationship pointing at an unknown dataset named Warning: customers currently prints the reference error and then Validation PASSED with exit 0, because severity was decided by searching the message text. With this patch it fails with exit 1. The key-coverage warning from #330 (which I wrote) stays nonfatal, and the case where a genuine warning and a real error appear together still exits 1.
Validating every semantic-model YAML in the repo (examples and converter fixtures, 11 files) gives identical results before and after, so nothing that passes today changes status.
One small observation, not a request: the Warning: prefix in the two messages is now purely cosmetic, since severity comes from the type. Keeping it seems right for the humans reading the output.
LGTM.
This fix marks warnings explicitly by using a typed error instead of a text prefix, so user-provided text cannot disguise errors as warnings. It adds regression tests and includes SQLGlot in CI to cover SQL errors.
Validation
Seven regression cases failed before the fix and pass afterward. All 54 validator tests pass locally on Python 3.14, and the canonical example validates successfully:
uv run validation/test_validate.py— 34 passeduv run --with pytest --with pyyaml --with jsonschema --with sqlglot -m pytest validation/tests/— 20 passeduv run validation/validate.py examples/tpcds_semantic_model.yaml— passedgit diff --check— passedChecklist
Validation
Tests
Compliance