-
Notifications
You must be signed in to change notification settings - Fork 151
Add SQL model validation for full and incremental models #7344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
55c87b0 to
7e94fd6
Compare
|
Longer term would be nice if the SQL test can also display what the failure was (the returned rows can include concatenated strings on what broke to help us debug further). Also surfacing them on end user explore dashboards. For instance if you're in finance looking at your finance dashboard and the underlying model has test failures, it is good to know that the data you're looking at failed some integrity tests. |
|
Anything left to do here? |
|
Wanted to bump here @begelundmuller |
@avaitla We've run into some tricky edge cases around how tests interact with model execution that are taking a while to get right. We're hoping to get this shipped soon! |
7c1f11a to
9ed8bbb
Compare
|
I like the mix of sql and assert, it makes the simple cases easier but still gives the power of flexible queries. Is there a simple for assert saying "user_id" is unique, or ("user_id", "date") is unique composite, thats another common case. Also curious when a few tests failed where they will appear and what the message says. Will the dashboard viewer see it somewhere to know the dashboard they're looking at has errors in the underlying model. |
Initially it will be surfaced through the existing "error handling popover" that appears in the lower third of the table results. I will be setting up some time with the frontend folks. Happy to capture your thoughts |
|
If an error is shown for tests, will the end dashboard still be up for end users? Ideally I imagine it could be. Would this be the best way to encode a unique column test? This is a good reference for some similar tests: https://cloud.google.com/bigquery/docs/reference/standard-sql/debugging-statements |
The model test errors will not prevent dashboards from being available to end users. If model tests fail, the reconciler returns an error, but it does not delete or roll back the model output. |
* feat: add model tests functionality * update supporting model tests * add model tests hash * make proto * fix: reorder web-local and web-integration in package-lock.json * Review * Prevent unnecessary state updates --------- Co-authored-by: Benjamin Egelund-Müller <[email protected]>
* feat: add model tests functionality * update supporting model tests * add model tests hash * make proto * fix: reorder web-local and web-integration in package-lock.json * Review * Prevent unnecessary state updates --------- Co-authored-by: Benjamin Egelund-Müller <[email protected]>
- Create comprehensive model validation documentation page - Document both 'assert' and 'sql' test syntaxes - Include examples for common validation patterns (null checks, ranges, duplicates, etc.) - Add complete example with various validation types - Document test execution behavior and best practices - Include guidance on test naming, organization, and performance - Add sections on working with incremental and partitioned models - Update models index to reference new validation page Related to PR #7344 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>

Add SQL model validation in the form of
assert. Assertions are SQL queries that SHOULD NOT return any rows.Example table
SELECT * FROM range(5)results in a range column containing0,1,2,3,4Example model.yaml
This example contains a mixture of both
sqlandassertsyntaxChecklist: