Complete the code to use the dbt-utils test to check for duplicates in a column.
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns: [[1]]The unique_combination_of_columns test checks that the specified column(s) have unique values. Here, id is the column to check for duplicates.
Complete the code to use the dbt-utils test to check if a column has any null values.
tests:
- dbt_utils.not_null:
column_name: [1]The not_null test checks that the specified column does not contain any null values. Here, user_id is the column to check.
Fix the error in the dbt-utils test to check if two columns together are unique.
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns: [[1]]The combination_of_columns expects a list of column names as strings inside brackets. The correct syntax is a list with quoted column names separated by commas.
Fill both blanks to write a dbt-utils test that checks if values in a column exist in another table's column.
tests:
- dbt_utils.relationships:
to: [1]
field: [2]The relationships test checks if values in the current model's field exist in the to model's primary key. Here, ref('customers') is the referenced table and customer_id is the column to check.
Fill all three blanks to write a dbt-utils test that checks if a column's values are within a list of allowed values.
tests:
- dbt_utils.accepted_values:
column: [1]
values: [[2]]
quote_values: [3]The accepted_values test checks if the column's values are only from the allowed list. The column is 'status', values is a list of allowed strings, and quote_values is true to treat values as strings.