Complete the code to define a simple test that checks if the column 'id' has no null values.
version: 2 models: - name: my_model tests: - not_null: column: [1]
The not_null test checks that the specified column has no null values. Here, the column is 'id'.
Complete the code to write a test that ensures the 'email' column contains unique values.
version: 2 models: - name: users tests: - unique: column: [1]
The unique test ensures that all values in the specified column are unique. Here, it is applied to the 'email' column.
Fix the error in the test definition to correctly check that the 'order_date' column has no nulls.
version: 2 models: - name: orders tests: - not_null: column: [1]
The column name must exactly match the model's column name. 'order_date' is the correct column name here.
Fill both blanks to create a test that checks if the 'status' column only contains allowed values.
version: 2 models: - name: transactions tests: - accepted_values: column: [1] values: [[2]]
The accepted_values test checks that the column only contains specified values. Here, 'status' must be one of 'completed', 'pending', or 'failed'.
Fill all three blanks to write a custom test that checks if the 'amount' column values are greater than zero.
version: 2 models: - name: payments tests: - custom_test: sql: "SELECT * FROM [1] WHERE [2] [3] 0"
ref() to reference the model.This custom test selects rows where 'amount' is less than or equal to zero (the failing rows). The ref('payments') function references the model.