expect_table_columns_to_not_contain_set
Feb 24, 2026
·
5
min read
Schema
·
dbt-expectations
·
Model,Seed,Source
How it Works
The expect_table_columns_to_not_contain_set test from the dbt-expectations package verifies that none of the columns in a specified list are present in the model. This is the inverse of expect_table_columns_to_contain_set and is useful for ensuring that deprecated columns, PII fields, or columns that should have been dropped are no longer part of a model's schema.
An optional transform argument (e.g., lower) enables case-insensitive comparison.
Steps and Conditions
Define Disallowed Columns: List the column names that must NOT be present.
Optional Transform: Apply a transform for case-insensitive matching.
Verification: Each disallowed column is checked against the actual schema.
Outcome: Pass if none of the disallowed columns exist; fail if any are found.
Example Usage: GDPR Compliance
A GDPR compliance team wants to ensure that personally identifiable fields like full_name and date_of_birth have been removed from a reporting-layer model.
If any of these PII columns remain in the reporting model, the test fails and blocks the deployment.





