0
0
dbtdata~20 mins

Test severity levels in dbt - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
dbt Test Severity Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding dbt test severity levels

In dbt, tests can have different severity levels that affect how failures are handled during runs. Which severity level causes dbt to fail the entire run if the test fails?

Apass
Berror
Cinfo
Dwarn
Attempts:
2 left
💡 Hint

Think about which severity level means the test failure is critical enough to stop the process.

Predict Output
intermediate
1:30remaining
Output of dbt test with warn severity

Given a dbt test configured with severity: warn and the test fails, what is the expected behavior in the dbt run output?

dbt
version: 2
models:
  - name: customers
    tests:
      - unique:
          column_name: id
          config:
            severity: warn
AThe run logs a warning but continues to completion.
BThe run fails and stops immediately.
CThe run ignores the test and does not log anything.
DThe run logs an error and retries the test.
Attempts:
2 left
💡 Hint

Severity 'warn' means the test failure is noted but does not stop the run.

data_output
advanced
2:00remaining
Number of failed tests by severity

After running dbt tests, you get a summary table with test results and their severity levels. How many tests with severity 'error' failed if the table below is given?

test_name       | severity | status
unique_id       | error    | fail
not_null_email  | warn     | pass
unique_email    | error    | fail
accepted_values | warn     | fail
A2
B3
C1
D0
Attempts:
2 left
💡 Hint

Count only tests with severity 'error' and status 'fail'.

🔧 Debug
advanced
2:00remaining
Identify severity misconfiguration causing unexpected run failure

A dbt test is configured as follows but the run fails unexpectedly when the test fails. Identify the misconfiguration.

tests:
  - not_null:
      column_name: user_id
      severity: warn

However, the run fails on this test failure.

ASeverity must be uppercase: <code>WARN</code> instead of <code>warn</code>.
BSeverity 'warn' is not supported and causes failure.
CThe test name is incorrect; it should be <code>not_null_test</code>.
DSeverity should be set under <code>config</code> block, not directly under test.
Attempts:
2 left
💡 Hint

Check where severity is placed in the test configuration.

🚀 Application
expert
2:30remaining
Choosing severity levels for different test scenarios

You manage a dbt project with critical and non-critical data quality tests. Which severity level should you assign to tests that must never fail without stopping the pipeline, and which to tests that should only log issues but allow the pipeline to continue?

ACritical tests: warn; Non-critical tests: error
BCritical tests: pass; Non-critical tests: warn
CCritical tests: error; Non-critical tests: warn
DCritical tests: info; Non-critical tests: error
Attempts:
2 left
💡 Hint

Think about which severity stops the pipeline and which only logs warnings.