Bird
0
0

Which of the following is the correct syntax to add a uniqueness test using dbt-utils in a model YAML file?

easy📝 Conceptual Q12 of 15
dbt - Advanced Testing
Which of the following is the correct syntax to add a uniqueness test using dbt-utils in a model YAML file?
Atests: - dbt_utils.unique: column_name: column_name
Btests: - dbt_utils.unique: ['column_name']
Ctests: - dbt_utils.unique - column_name
Dtests: - dbt_utils.unique: {column_name}
Step-by-Step Solution
Solution:
  1. Step 1: Recall dbt-utils test syntax in YAML

    The correct syntax uses column_name parameter under the test, like dbt_utils.unique: column_name: column_name.
  2. Step 2: Check each option format

    tests: - dbt_utils.unique: column_name: column_name correctly uses the column_name key-value pair, matching dbt-utils documentation.
  3. Final Answer:

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

    Unique test syntax = column_name key [OK]
Quick Trick: Use column_name: column_name for dbt_utils.unique [OK]
Common Mistakes:
MISTAKES
  • Broken YAML with multiple dashes
  • Using list ['column_name'] instead of column_name key
  • Using curly braces for parameters

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes