Bird
0
0

You wrote this test in your YAML file:

medium📝 Debug Q14 of 15
dbt - Advanced Testing
You wrote this test in your YAML file:
columns:
  - name: order_id
    tests:
      unique
      not_null

But when you run dbt test, it fails with a syntax error. What is the likely cause?
AUsing 'tests' instead of 'test' key
BIncorrect indentation of 'name' key
CMissing quotes around test names
DMissing dash (-) before 'unique' and 'not_null' tests
Step-by-Step Solution
Solution:
  1. Step 1: Check YAML list syntax for tests

    Each test under 'tests' must be a list item starting with a dash (-).
  2. Step 2: Identify missing dashes

    The snippet shows 'unique' and 'not_null' without dashes, causing YAML syntax error.
  3. Final Answer:

    Missing dash (-) before 'unique' and 'not_null' tests -> Option D
  4. Quick Check:

    YAML lists need dash (-) before each item [OK]
Quick Trick: Always put dash (-) before each test in YAML list [OK]
Common Mistakes:
MISTAKES
  • Omitting dash (-) before tests
  • Wrong indentation levels
  • Confusing 'tests' with 'test' key

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes