Data tests
Looker provides a couple of tools to ensure the accuracy and integrity of your data models and visualizations:
- The LookML Validator checks for syntactic errors in your LookML code
- The Content Validator verifies that object references within your content align with your data model
Data tests (the test
parameter) enable you to validate the logic of your model, to perform unit testing before pushing new code into production, by creating queries and corresponding yes/no assertion statements. The data test executes the test query and verifies that the assertion holds true for each row of the query. If the assertion evaluates yes for every row, the data test is considered successful.
The test parameter has the following subparameters:
explore_source
: Defines the query that provides the data for your testassert
: Sets the criteria your data must meet to pass the test
If your project settings mandate that data tests pass before deployment...