not_empty_string

Feb 24, 2026

·

5

min read

Values format, Null handling

·

dbt-utils

·

Model,Column

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

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.