Singular tests
Singular tests are simple SQL queries that return failing records of a model or a resource. They are typically used for one-off checks or specific business rules that do not require reusability.
You can use Jinja functions like ref()
and source()
to make reference to the target resource.
For example, we can create a singular test that checks for suspicious payments by method in the stg_payments
table:
Notice that the singular test accepts no parameters as it's only applied on the stg_orders
model.
Create a singular test
To add a singular test to a model:
Open the Test case template and select / search for the Singular Test template.
Fill in the name, description, and SQL contents.
Click Save.
Once added, you can verify the test by running the model in Console.
Last updated