Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing
Back
  1. Home
  2. Interview prep
  3. Test severity: error vs warn

dbt · Testing & Documentation

Test severity: error vs warn

Mediumdbt-14
severitywarnerrortestsci

Question

What do test severity levels error and warn mean in dbt?

Solution

Test severity controls whether a failing test fails the dbt invocation or only warns.

error (default)

If the test finds failing rows, dbt marks the test as failed and the CLI exits non-zero (depending on flags / build behavior). Use for hard contracts: primary keys, critical FKs, amounts that must never be null.

warn

Failures show up as warnings but do not necessarily fail the whole job. Useful for:

  • Newly added tests while cleaning historical bad data
  • Soft SLAs (e.g. "prefer unique emails, but legacy dupes exist")
  • Monitoring drift before enforcing a hard gate
columns:
  - name: email
    tests:
      - unique:
          config:
            severity: warn

Mental model

severity: error  →  "block the pipeline / fail CI"
severity: warn   →  "raise visibility, keep going (for now)"

Related knobs

You may also see store_failures, where filters on tests, and warn_if / error_if style thresholds on some tests/packages to tolerate small failure counts.

Interview tip: "Start new quality rules as warn while remediating data, then flip to error once the warehouse is clean so CI protects the contract."

PreviousNext