expect_column_values_to_not_be_in_set
Feb 24, 2026
·
5
min read
Values set
·
dbt-expectations
·
Column
How it Works
The expect_column_values_to_not_be_in_set test from the dbt-expectations package verifies that none of the values in a column match any value from a specified exclusion set. This is the inverse of expect_column_values_to_be_in_set and is useful for flagging deprecated, invalid, or sentinel values that should no longer appear in production data.
The quote_values argument (default true) controls whether values in the set are treated as strings. A row_condition can be used to scope the check to a subset of rows.
Steps and Conditions
Column Selection: Choose the column to validate.
Define Exclusion Set: List values that must not appear using
value_set.Optional Row Condition: Filter rows before evaluation with
row_condition.Execution: Each row is checked; any match to the exclusion set triggers a failure.
Outcome: Pass if no values appear in the set; fail if any do.
Example Usage: HR Platform
An HR platform retired several employment status codes but wants to ensure they no longer appear in active employee records.
This guarantees that active employee records only carry valid, current status codes.





