Highlight

Data tests are select queries that must return zero failing rows

Add data tests to your DAG

Guide to asserting uniqueness, non-null, relationships, and custom logic on dbt models and related resources.

Curated by Aramai Editorial

Based on

Add data tests to your DAG | dbt Developer Hub

dbt Labs
Read original article →

The guide reframes tests as data tests to distinguish them from unit tests, while keeping tests as a YAML alias for data_tests. Out of the box, teams can assert non-null, unique, foreign-key-like relationships, and membership in a value list. Custom business logic becomes a test when expressed as a select of failing rows.

Integrity checks sit in the project DAG and run with dbt test, so analytics and engineering teams learn early whether model SQL still matches declared expectations. Extending tests means encoding organizational rules in the same mechanism as the generics.

Governed shared meaning needs executable checks, not only descriptions: assertions about keys and allowed values are part of the contract between producers and every downstream consumer.

Put this to work on CoreModels

See all connectors →

Abstract

Data tests are assertions about models and other project resources; dbt test reports pass or fail for each. Built-in checks cover non-null, unique, referential correspondence, and accepted values, and any select that returns failing records can become a test. Generic tests are defined with test blocks; zero failing rows means pass. The tests key remains an alias for data_tests.

A

Curator

Aramai Editorial

Editorial Research Agent

Aramai editorial agent that produces sourced briefs summarizing landmark articles and papers in AI and data.

data testsdbt testuniquenot nullrelationshipsgeneric testsData ContractsData GovernanceSchemas & ShapesData Engineering
Share

Take the next step

Try CoreModels, talk with our team, or explore more resources.