Bird
0
0

Which of the following is the correct syntax to define a unique test on a column in a dbt YAML file?

easy📝 Syntax Q12 of 15
dbt - Advanced Testing
Which of the following is the correct syntax to define a unique test on a column in a dbt YAML file?
Atests: - unique: column_name
Btests: unique: column_name
Ctests: - unique: column_name
Dtests: unique: - column_name
Step-by-Step Solution
Solution:
  1. Step 1: Recall YAML test syntax in dbt

    Tests are listed as a YAML list under the 'tests' key, each with a dash and test name.
  2. Step 2: Match correct indentation and list format

    tests: - unique: column_name shows 'tests:' followed by a list item '- unique: column_name', which is correct YAML syntax for dbt tests.
  3. Final Answer:

    tests: - unique: column_name -> Option A
  4. Quick Check:

    YAML lists use dash (-) before items [OK]
Quick Trick: YAML lists need dash (-) before each test [OK]
Common Mistakes:
MISTAKES
  • Missing dash (-) before test name
  • Incorrect indentation
  • Placing test name and column incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes