dbt - Advanced TestingWhich of the following is the correct syntax to define a unique test on a column in a dbt YAML file?Atests: - unique: column_nameBtests: unique: column_nameCtests: - unique: column_nameDtests: unique: - column_nameCheck Answer
Step-by-Step SolutionSolution:Step 1: Recall YAML test syntax in dbtTests are listed as a YAML list under the 'tests' key, each with a dash and test name.Step 2: Match correct indentation and list formattests: - unique: column_name shows 'tests:' followed by a list item '- unique: column_name', which is correct YAML syntax for dbt tests.Final Answer:tests: - unique: column_name -> Option AQuick Check:YAML lists use dash (-) before items [OK]Quick Trick: YAML lists need dash (-) before each test [OK]Common Mistakes:MISTAKESMissing dash (-) before test nameIncorrect indentationPlacing test name and column incorrectly
Master "Advanced Testing" in dbt9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More dbt Quizzes Advanced Testing - Generic tests with parameters - Quiz 11easy Incremental Models - Why incremental models save time and cost - Quiz 10hard Incremental Models - Full refresh vs incremental - Quiz 7medium Incremental Models - Incremental strategies (append, merge, delete+insert) - Quiz 11easy Incremental Models - Handling late-arriving data - Quiz 12easy Incremental Models - is_incremental() macro - Quiz 7medium Jinja in dbt - Macros for reusable SQL logic - Quiz 3easy Jinja in dbt - For loops for dynamic SQL - Quiz 2easy Packages and Reusability - dbt-date for date spine - Quiz 13medium Packages and Reusability - dbt-date for date spine - Quiz 1easy