Complete the code to add a dbt-expectation that checks if the column 'user_id' has no null values.
expect_column_values_to_not_be_null('[1]')
This expectation checks that the 'user_id' column does not contain any null values, ensuring data completeness for user identifiers.
Complete the code to expect that the 'order_amount' column values are greater than zero.
expect_column_values_to_be_between('[1]', min_value=0, strict_min=True)
This expectation ensures that all values in the 'order_amount' column are strictly greater than zero, which is important for valid sales data.
Fix the error in the dbt-expectation code to check that 'email' column values match a simple email pattern.
expect_column_values_to_match_regex('[1]', regex=r'^[\w\.-]+@[\w\.-]+\.\w+$')
The expectation uses a regex to check that the 'email' column values look like valid email addresses. The correct column to check is 'email'.
Fill both blanks to create a dbt-expectation that checks if 'signup_date' values are between '2020-01-01' and '2023-12-31'.
expect_column_values_to_be_between('[1]', min_value='[2]', max_value='2023-12-31')
This expectation ensures that the 'signup_date' column values fall within the specified date range from January 1, 2020 to December 31, 2023.
Fill all three blanks to create a dictionary that maps each column to an expectation checking values are not null and unique.
expectations = { '[1]': ['expect_column_values_to_not_be_null', 'expect_column_values_to_be_unique'], '[2]': ['expect_column_values_to_not_be_null', 'expect_column_values_to_be_unique'], '[3]': ['expect_column_values_to_not_be_null', 'expect_column_values_to_be_unique'] }This dictionary sets expectations for 'user_id', 'email', and 'order_id' columns to ensure their values are not null and unique, which is important for identifiers.