Challenge - 5 Problems
dbt-expectations Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Output of a dbt-expectations test on null values
Given the following dbt-expectations test configuration, what will be the result when run on a table where 5% of the rows have null values in the
email column?tests:
- dbt_expectations.expect_column_values_to_not_be_null:
column: email
mostly: 0.95Attempts:
2 left
💡 Hint
The
mostly parameter allows some exceptions up to the given threshold.✗ Incorrect
The
expect_column_values_to_not_be_null test with mostly: 0.95 means the test passes if at least 95% of the values are not null. Since 5% are null, the test passes.❓ data_output
intermediate2:00remaining
Resulting data from a uniqueness test
You run the following dbt-expectations test on the
What is the expected output if the table contains duplicate
user_id column:tests:
- dbt_expectations.expect_column_values_to_be_unique:
column: user_idWhat is the expected output if the table contains duplicate
user_id values?Attempts:
2 left
💡 Hint
Uniqueness tests identify duplicates and fail if any exist.
✗ Incorrect
The uniqueness test fails if duplicates exist and returns the rows causing failure.
❓ visualization
advanced2:00remaining
Visualizing distribution with dbt-expectations
You want to check if the
age column in your dataset follows a normal distribution using dbt-expectations. Which visualization would best help you confirm this after running the test?Attempts:
2 left
💡 Hint
Normal distribution is best visualized with histograms and density curves.
✗ Incorrect
A histogram with a normal curve overlay shows how closely the data matches a normal distribution.
🧠 Conceptual
advanced2:00remaining
Understanding the use of
mostly in dbt-expectationsWhat is the main purpose of the
mostly parameter in dbt-expectations tests?Attempts:
2 left
💡 Hint
Think about tolerance for exceptions in data quality tests.
✗ Incorrect
The
mostly parameter sets a threshold for how many rows must satisfy the condition for the test to pass.🔧 Debug
expert2:00remaining
Identifying error in a dbt-expectations test configuration
You wrote this test in your dbt model:
When running dbt, you get an error. What is the cause?
tests:
- dbt_expectations.expect_column_values_to_be_in_set:
column: status
value_set: ['active', 'inactive', 'pending']When running dbt, you get an error. What is the cause?
Attempts:
2 left
💡 Hint
Check the exact parameter name required by dbt-expectations for this test.
✗ Incorrect
The correct parameter name is
value_set, but the test uses value_set which is invalid and causes an error.