Challenge - 5 Problems
dbt Test Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Output of a dbt test run with a failing test
What is the output shown when you run
dbt test and one of the tests fails due to a uniqueness violation?dbt
dbt test
Attempts:
2 left
💡 Hint
Think about what dbt reports when a uniqueness test fails.
✗ Incorrect
When a uniqueness test fails, dbt reports the test name, the model and column tested, and the number of failing rows.
🧠 Conceptual
intermediate1:30remaining
Purpose of dbt test command
What is the main purpose of running
dbt test in a dbt project?Attempts:
2 left
💡 Hint
Think about what tests in dbt are used for.
✗ Incorrect
dbt test runs tests that check data quality and integrity, such as uniqueness, not null, and custom tests.❓ data_output
advanced2:00remaining
Result of a custom test returning rows
You define a custom test in dbt that returns rows where
order_amount is negative. What does dbt test output if 5 rows violate this condition?dbt
select * from {{ ref('orders') }} where order_amount < 0
Attempts:
2 left
💡 Hint
Custom tests fail when they return any rows.
✗ Incorrect
dbt tests fail if the SQL query returns any rows, indicating data issues.
🔧 Debug
advanced2:00remaining
Error when running dbt test with missing test file
You run
dbt test but get an error: Compilation Error: Could not find test file 'not_null_user_id.sql'. What is the cause?Attempts:
2 left
💡 Hint
Check where dbt expects test files to be located.
✗ Incorrect
dbt looks for test SQL files in the tests directory; if missing, it raises a compilation error.
🚀 Application
expert3:00remaining
Interpreting dbt test summary output
After running
What should you do next?
dbt test, you see this summary:PASS 1/3 tests
FAIL 2/3 tests
- test_not_null on model customers
- test_unique on model ordersWhat should you do next?
Attempts:
2 left
💡 Hint
Failing tests indicate data problems that need attention.
✗ Incorrect
Failing tests show data quality issues; you should investigate and fix the root causes.