dbt Tests

not_empty_string

dbt-utils

·

Model,Column

·

Values format, Null handling

How it Works

The not_empty_string test from dbt-utils™ validates that a column contains no empty string values (''). This is a common complement to not_null — many systems store empty strings instead of nulls, which can silently break string operations, lookups, or email-sending logic.

An optional trim_whitespace argument (default true) strips whitespace before the empty check, catching values like ' ' that would otherwise pass.

Steps and Conditions

  1. Column Selection: Identify the string column to validate.

  2. Trim Setting: Configure trim_whitespace to control whitespace handling.

  3. Execution: Each value is checked for emptiness after optional trimming.

  4. Outcome: Pass if no empty strings are found; fail if any are present.

Example Usage: Email Marketing

An email marketing platform requires that all subscriber email addresses are non-empty strings, not just non-null.

models:
  - name: subscribers
    columns:
      - name: email_address
        tests:
          - dbt_utils.not_empty_string:
              trim_whitespace: true
models:
  - name: subscribers
    columns:
      - name: email_address
        tests:
          - dbt_utils.not_empty_string:
              trim_whitespace: true
models:
  - name: subscribers
    columns:
      - name: email_address
        tests:
          - dbt_utils.not_empty_string:
              trim_whitespace: true

Empty or whitespace-only email addresses would cause mailing failures, so this test prevents them from reaching the email send queue.

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.