Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@royendo
Copy link
Contributor

@royendo royendo commented Oct 31, 2025

Summary

This PR adds comprehensive documentation for model validation, a feature added in PR #7344.

What's Included

  • New Documentation Page (model-validation.md)

    • Overview of model validation and when to use it
    • Complete syntax documentation for assert and sql test types
    • Examples for common validation patterns:
      • Null checks
      • Range validations
      • Uniqueness constraints
      • Referential integrity
      • Aggregate validations
      • Business logic checks
    • Complete working example with multiple test types
    • Test execution behavior and result viewing
    • Best practices for naming, organization, and performance
    • Usage with incremental and partitioned models
    • Common patterns and limitations
  • Updated Models Index - Added reference to validation page in the Fundamentals section

Documentation Highlights

The documentation covers:

  • Both assert (condition-based) and sql (query-based) test syntaxes
  • When to use each test type
  • How tests execute during model refresh
  • How to view test results
  • Performance considerations
  • Testing strategies
  • Real-world examples and patterns

Related

🤖 Generated with Claude Code

- 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]>
Copy link
Contributor Author

@royendo royendo left a comment

Choose a reason for hiding this comment

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

General thoughts?


## Viewing Test Results

Test results are stored in the model state and visible in:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@grahamplata to my knowledge, we dont surface this in the UI today right? How does a user see when a model validation fails?

Copy link
Member

Choose a reason for hiding this comment

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

There isn't anything available in cloud at the moment

- Number of rows that failed the test
- Sample of the failing rows (if applicable)

## Best Practices
Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you think about this section?

assert: order_date >= '2020-01-01'
```

### Choosing Between Assert and SQL
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this true?

@royendo royendo marked this pull request as ready for review November 3, 2025 14:45
@royendo
Copy link
Contributor Author

royendo commented Nov 3, 2025

@grahamplata can you look at the remaining two questions?

@royendo royendo changed the title docs: Add model validation documentation docs: Add model validation documentation (for PR #7344) Nov 3, 2025
@royendo royendo requested review from ericpgreen2 and removed request for ericpgreen2 November 3, 2025 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants