dbt Tests

not_null

dbt-core

·

Model,Column

·

Null handling

How it Works

The not_null test is one of dbt™'s four built-in generic tests. It validates that a column contains no null values. This is the most fundamental data completeness check in dbt™ and is typically applied to primary keys, foreign keys, and any column that downstream logic depends on being populated.

Steps and Conditions

  1. Column Selection: Identify the column to validate.

  2. Execution: Every row is checked for null values.

  3. Outcome: Pass if no nulls are found; fail if any nulls are present.

Example Usage: Customer Table

A customer table should never have a null customer_id, as it would break all downstream joins and aggregations.

models:
  - name: customers
    columns:
      - name: customer_id
        tests

models:
  - name: customers
    columns:
      - name: customer_id
        tests

models:
  - name: customers
    columns:
      - name: customer_id
        tests

This ensures that every customer record has a valid identifier, preventing broken joins and missing records in all downstream models.

Interested to Learn More?
Try Out the Free 14-Days Trial

Stop Managing Pipelines. Start Shipping Them.

Join the teams that replaced manual dbt™ workflows with agentic AI. Free to start, no credit card required.

Stop Managing Pipelines. Start Shipping Them.

Join the teams that replaced manual dbt™ workflows with agentic AI. Free to start, no credit card required.

Stop Managing Pipelines. Start Shipping Them.

Join the teams that replaced manual dbt™ workflows with agentic AI. Free to start, no credit card required.

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.