Bird
0
0

Which of the following is the correct syntax to define a custom test in dbt?

easy📝 Conceptual Q12 of 15
dbt - Advanced Testing
Which of the following is the correct syntax to define a custom test in dbt?
Atests: unique_test: test: unique column_name: id
Btests: - unique_test: column_name: id
Ctests: - name: unique_test test: unique column_name: id
Dtests: - name: unique_test test: unique column_name: id severity: error
Step-by-Step Solution
Solution:
  1. Step 1: Review dbt test YAML syntax

    Custom tests in dbt are defined with a name, test type, column, and optional severity in a list format.
  2. Step 2: Identify correct structure

    tests: - name: unique_test test: unique column_name: id severity: error correctly uses a list item with name, test, column_name, and severity keys.
  3. Final Answer:

    tests:\n - name: unique_test\n test: unique\n column_name: id\n severity: error -> Option D
  4. Quick Check:

    Correct YAML list with keys = tests: - name: unique_test test: unique column_name: id severity: error [OK]
Quick Trick: Custom tests need name, test, column, and optional severity [OK]
Common Mistakes:
MISTAKES
  • Using incorrect YAML indentation
  • Missing the 'name' key for the test
  • Not using a list for multiple tests

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More dbt Quizzes