where

Changelog

Filter the resource being tested (model, source, seed, or snapshot).

The where condition is templated into the test query by replacing the resource reference with a subquery. For instance, a not_null test may look like:

select *
from my_model
where my_column is null

If the where config is set to where date_column = current_date, then the test query will be updated to:

select *
from (select * from my_model where date_column = current_date) my_model
where my_column is null

Configure a specific instance of a generic (schema) test:

models/<filename>.yml
version: 2
models:
- name: large_table
columns:
- name: my_column
tests:
- accepted_values:
values: ["a", "b", "c"]
where: "date_column = current_date"