expect_column_values_to_not_be_null

Feb 24, 2026

·

5

min read

Null handling

·

dbt-expectations

·

Column

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'"
models:
  - name: orders
    columns:
      - name: tracking_number
        tests:
          - dbt_expectations.expect_column_values_to_not_be_null:
              row_condition: "status = 'shipped'"
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

More Articles

decorative icon

Experience Analytics for the AI-Era

Start your 14-day trial today - it's free and no credit card needed

decorative icon

Experience Analytics for the AI-Era

Start your 14-day trial today - it's free and no credit card needed

decorative icon

Experience Analytics for the AI-Era

Start your 14-day trial today - it's free and no credit card needed

Copyright © 2026 Paradime Labs, Inc.

Made with ❤️ in San Francisco ・ London

*dbt® and dbt Core® are federally registered trademarks of dbt Labs, Inc. in the United States and various jurisdictions around the world. Paradime is not a partner of dbt Labs. All rights therein are reserved to dbt Labs. Paradime is not a product or service of or endorsed by dbt Labs, Inc.

Copyright © 2026 Paradime Labs, Inc.

Made with ❤️ in San Francisco ・ London

*dbt® and dbt Core® are federally registered trademarks of dbt Labs, Inc. in the United States and various jurisdictions around the world. Paradime is not a partner of dbt Labs. All rights therein are reserved to dbt Labs. Paradime is not a product or service of or endorsed by dbt Labs, Inc.

Copyright © 2026 Paradime Labs, Inc.

Made with ❤️ in San Francisco ・ London

*dbt® and dbt Core® are federally registered trademarks of dbt Labs, Inc. in the United States and various jurisdictions around the world. Paradime is not a partner of dbt Labs. All rights therein are reserved to dbt Labs. Paradime is not a product or service of or endorsed by dbt Labs, Inc.