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
Column Selection: Identify the string column to validate.
Trim Setting: Configure
trim_whitespaceto control whitespace handling.Execution: Each value is checked for emptiness after optional trimming.
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.
Empty or whitespace-only email addresses would cause mailing failures, so this test prevents them from reaching the email send queue.





