Skip to content

Commit

Permalink
Update website/docs/docs/build/data-tests.md
Browse files Browse the repository at this point in the history
Co-authored-by: Grace Goheen <[email protected]>
  • Loading branch information
matthewshaver and graciegoheen authored Dec 7, 2023
1 parent ca9395f commit d4c9d1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion website/docs/docs/build/data-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ You can use data tests to improve the integrity of the SQL in each model by maki

Data tests return a set of failing records. Generic data tests (f.k.a. schema tests) are defined using `test` blocks.

Like almost everything in dbt, data tests are SQL queries. In particular, they are `select` statements that seek to grab "failing" records, ones that disprove your assertion. If you assert that a column is unique in a model, the test query selects for duplicates; if you assert that a column is never null, the test seeks after nulls. If the test returns zero failing rows, it passes, and your assertion has been validated.
Like almost everything in dbt, data tests are SQL queries. In particular, they are `select` statements that seek to grab "failing" records, ones that disprove your assertion. If you assert that a column is unique in a model, the test query selects for duplicates; if you assert that a column is never null, the test seeks after nulls. If the data test returns zero failing rows, it passes, and your assertion has been validated.

There are two ways of defining data tests in dbt:
* A **singular** test is testing in its simplest form: If you can write a SQL query that returns failing rows, you can save that query in a `.sql` file within your [test directory](/reference/project-configs/test-paths). It's now a test, and it will be executed by the `dbt test` command.
Expand Down

0 comments on commit d4c9d1b

Please sign in to comment.