Complete the code to define a generic test that checks if a column has no null values.
version: 2 models: - name: users columns: - name: email tests: - not_null: [1]: true
The enabled parameter is used to activate or deactivate a test in dbt.
Complete the code to pass a parameter to a generic test that checks if values are greater than a threshold.
tests:
- dbt_utils.expression_is_true:
expression: "{{ column_name }} > {{ params.[1] }}"The parameter threshold is commonly used to specify the minimum value in tests.
Fix the error in the generic test definition by completing the missing parameter name.
tests:
- dbt_utils.unique_combination_of_columns:
combination_of_columns: ["user_id", [1]]The column names must be strings inside quotes in the list.
Fill both blanks to create a generic test that checks if a column's values are within a list of allowed values.
tests:
- dbt_utils.accepted_values:
column_name: [1]
values: [2]The column_name must be a string, and values must be a list of allowed strings.
Fill all three blanks to define a generic test with parameters for a column, a threshold, and a severity level.
tests:
- dbt_utils.expression_is_true:
expression: "{{ [1] }} > {{ params.[2] }}"
severity: [3]The expression uses the column_name and threshold parameters, and severity is set to "ERROR" to mark test failures clearly.