Skip to content

Commit

Permalink
Merge branch 'current' into tab-borders
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewshaver authored Feb 6, 2025
2 parents e37bb11 + 441e2d4 commit 7e5c67a
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions website/docs/reference/data-test-configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ version: 2
tests:
- <test_name>: # # Actual name of the test. For example, dbt_utils.equality
name: # Human friendly name for the test. For example, equality_fct_test_coverage
[description](/reference/resource-properties/description): "markdown formatting"
<argument_name>: <argument_value>
[config](/reference/resource-properties/config):
[fail_calc](/reference/resource-configs/fail_calc): <string>
Expand All @@ -102,6 +103,7 @@ version: 2
tests:
- <test_name>:
name:
[description](/reference/resource-properties/description): "markdown formatting"
<argument_name>: <argument_value>
[config](/reference/resource-properties/config):
[fail_calc](/reference/resource-configs/fail_calc): <string>
Expand Down Expand Up @@ -182,6 +184,7 @@ version: 2
tests:
- <test_name>: # Actual name of the test. For example, dbt_utils.equality
name: # Human friendly name for the test. For example, equality_fct_test_coverage
[description](/reference/resource-properties/description): "markdown formatting"
<argument_name>: <argument_value>
[config](/reference/resource-properties/config):
[enabled](/reference/resource-configs/enabled): true | false
Expand All @@ -197,6 +200,7 @@ version: 2
tests:
- <test_name>:
name:
[description](/reference/resource-properties/description): "markdown formatting"
<argument_name>: <argument_value>
[config](/reference/resource-properties/config):
[enabled](/reference/resource-configs/enabled): true | false
Expand Down Expand Up @@ -296,3 +300,41 @@ models:
```

Given the config, the data test runs on a different Snowflake virtual warehouse than the one in your default connection to enable better price-performance with a different warehouse size or more granular cost allocation and visibility.

#### Add a description to generic and singular tests

Starting from dbt v1.9 (also available to dbt Cloud [release tracks](/docs/dbt-versions/cloud-release-tracks)), you can add [descriptions](/reference/resource-properties/data-tests#description) to both generic and singular tests.

For a generic test, add the description in line with the existing YAML:

<File name='models/staging/<filename>.yml'>

```yml
models:
- name: my_model
columns:
- name: delivery_status
tests:
- accepted_values:
values: ['delivered', 'pending', 'failed']
description: "This test checks whether there are unexpected delivery statuses. If it fails, check with logistics team"
```
</File>

For a singular test, define it in the test's directory:

<File name='tests/my_custom_test.yml'>

```yml
data_tests:
- name: my_custom_test
description: "This test checks whether the rolling average of returns is inside of expected bounds. If it isn't, flag to customer success team"
```
</File>

For more information refer to [Add a description to a data test](/reference/resource-properties/description#add-a-description-to-a-data-test).

0 comments on commit 7e5c67a

Please sign in to comment.