Bird
0
0

Given this YAML snippet for a dbt test:

medium📝 Predict Output Q13 of 15
dbt - Advanced Testing
Given this YAML snippet for a dbt test:
columns:
  - name: user_id
    tests:
      - unique
      - not_null

What will dbt test check for the user_id column?
AIt checks that user_id values are duplicated and null
BIt checks that user_id values are unique and not null
CIt only checks if user_id is unique
DIt only checks if user_id is not null
Step-by-Step Solution
Solution:
  1. Step 1: Read the tests listed for user_id

    The YAML shows two tests: 'unique' and 'not_null' for the user_id column.
  2. Step 2: Understand what each test does

    'unique' ensures no duplicate values; 'not_null' ensures no missing values.
  3. Final Answer:

    It checks that user_id values are unique and not null -> Option B
  4. Quick Check:

    unique + not_null = no duplicates, no nulls [OK]
Quick Trick: Multiple tests run together on the same column [OK]
Common Mistakes:
MISTAKES
  • Thinking tests check opposite conditions
  • Assuming only one test runs
  • Confusing unique with not_null

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes