From 1cb1104bfcf7e6a575e6681bfff62201ca6200ca Mon Sep 17 00:00:00 2001 From: Joost Boonzajer Flaes Date: Wed, 18 Feb 2026 22:29:19 +0200 Subject: [PATCH] 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 --- docs/data-tests/volume-threshold.mdx | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/data-tests/volume-threshold.mdx b/docs/data-tests/volume-threshold.mdx index 0c2da24f0..83ccb136f 100644 --- a/docs/data-tests/volume-threshold.mdx +++ b/docs/data-tests/volume-threshold.mdx @@ -77,7 +77,7 @@ models: tags: ["elementary"] ``` -```yml Custom thresholds +```yml Custom thresholds - drop only models: - name: critical_transactions data_tests: @@ -89,7 +89,6 @@ models: direction: drop config: tags: ["elementary"] - severity: error ``` ```yml With time bucket and filter @@ -144,6 +143,23 @@ models: | Configuration | Explicit thresholds | Sensitivity tuning | | Baseline | Previous bucket | Training period average | +### How severity levels work + +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: + +- Change exceeds `warn_threshold_percent` but not `error_threshold_percent` → **dbt warning** +- Change exceeds `error_threshold_percent` → **dbt error** (test fails) +- Change is below `warn_threshold_percent` → **pass** + +For example, with `warn_threshold_percent: 3` and `error_threshold_percent: 8`: +- A 2% drop → pass +- A 5% drop → warning +- A 10% drop → error + + +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. + + ### Notes - The `warn_threshold_percent` must be less than or equal to `error_threshold_percent`