Skip to content

Commit 1cb1104

Browse files
joostboonclaude
andcommitted
Clarify volume_threshold severity behavior and fix example
- Remove misleading config.severity: error from example - Add "How severity levels work" section explaining the built-in dual severity (warn_if/error_if) behavior - Add warning about not overriding with config.severity Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4121a3f commit 1cb1104

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

docs/data-tests/volume-threshold.mdx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ models:
7777
tags: ["elementary"]
7878
```
7979
80-
```yml Custom thresholds
80+
```yml Custom thresholds - drop only
8181
models:
8282
- name: critical_transactions
8383
data_tests:
@@ -89,7 +89,6 @@ models:
8989
direction: drop
9090
config:
9191
tags: ["elementary"]
92-
severity: error
9392
```
9493
9594
```yml With time bucket and filter
@@ -144,6 +143,23 @@ models:
144143
| Configuration | Explicit thresholds | Sensitivity tuning |
145144
| Baseline | Previous bucket | Training period average |
146145

146+
### How severity levels work
147+
148+
This test has built-in dual severity using dbt's `warn_if` / `error_if` config. You do **not** need to set `config.severity` yourself. The behavior is:
149+
150+
- Change exceeds `warn_threshold_percent` but not `error_threshold_percent` → **dbt warning**
151+
- Change exceeds `error_threshold_percent` → **dbt error** (test fails)
152+
- Change is below `warn_threshold_percent` → **pass**
153+
154+
For example, with `warn_threshold_percent: 3` and `error_threshold_percent: 8`:
155+
- A 2% drop → pass
156+
- A 5% drop → warning
157+
- A 10% drop → error
158+
159+
<Warning>
160+
Do not set `config.severity: error` on this test. That would override the built-in dual severity and turn all warnings into errors, defeating the purpose of having separate thresholds.
161+
</Warning>
162+
147163
### Notes
148164

149165
- The `warn_threshold_percent` must be less than or equal to `error_threshold_percent`

0 commit comments

Comments
 (0)