Bird
0
0

If a dbt test is defined as:

medium📝 Predict Output Q5 of 15
dbt - Advanced Testing
If a dbt test is defined as:
tests:
- accepted_values:
values: ['active', 'inactive']

What will happen if a row has the value 'pending' in the tested column?
AThe test will throw a runtime error
BThe test will pass because 'pending' is treated as null
CThe test will ignore the row with 'pending'
DThe test will fail because 'pending' is not an accepted value
Step-by-Step Solution
Solution:
  1. Step 1: Understand accepted_values test

    This test checks if column values are in the specified list.
  2. Step 2: Analyze the effect of an unexpected value

    Any value not in the list causes the test to fail.
  3. Final Answer:

    The test will fail because 'pending' is not an accepted value -> Option D
  4. Quick Check:

    Accepted values test fails on unexpected values [OK]
Quick Trick: Accepted_values test fails on values outside the list [OK]
Common Mistakes:
MISTAKES
  • Assuming unexpected values are ignored
  • Thinking test treats unknown values as null
  • Expecting runtime errors from invalid values

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes