expect_column_values_to_not_be_null

Feb 23, 2026dbt-expectations · Column · Null handling

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

  1. Column Selection: Identify the column to evaluate.
  2. Optional Row Condition: Filter rows using row_condition.
  3. Execution: Each row is checked for null values.
  4. 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.