expect_column_values_to_not_be_null
How it Works
The expect_column_values_to_not_be_null test from the dbt-expectations package is functionally equivalent to the native dbt™ not_null test but comes from the dbt-expectations package, allowing it to be used alongside other dbt-expectations tests in a consistent manner. It validates that every value in a column is not null.
An optional row_condition argument allows scoping the test to a relevant subset of rows.
Steps and Conditions
- Column Selection: Identify the column to evaluate.
- Optional Row Condition: Filter rows using
row_condition. - Execution: Each row is checked for null values.
- Outcome: Pass if no nulls are found; fail if any are present.
Example Usage: Order Processing
An order processing pipeline requires that every shipped order has a non-null tracking_number.
models:
- name: orders
columns:
- name: tracking_number
tests:
- dbt_expectations.expect_column_values_to_not_be_null:
row_condition: "status = 'shipped'"Any shipped order missing a tracking number fails the test and triggers an investigation into the fulfilment system.
Interested to Learn More? Try Out the Free 14-Days Trial
One AI-native workspace to build, ship, and monitor dbt™ — without the tool sprawl.
Join industry leaders winning with DinoAI agents
Data engineers and analysts at the most AI-native startups and enterprises use Paradime's DinoAI agents everyday to become market leaders.