expect_column_values_to_be_in_set
Feb 24, 2026
·
5
min read
Values set
·
dbt-expectations
·
Column
How it Works
The expect_column_values_to_be_in_set test from the dbt-expectations package validates that every value in a column is a member of a specified allowed set. This is the row-level equivalent of expect_column_distinct_values_to_be_in_set — it checks every individual row, not just the set of distinct values.
An optional quote_values argument controls whether list values are treated as strings, and row_condition can scope the test to a subset of rows.
Steps and Conditions
Column Selection: Choose the column to validate.
Define Allowed Set: List acceptable values using
value_set.Optional Config: Use
quote_valuesandrow_conditionas needed.Execution: Every row is checked against the allowed set.
Outcome: Pass if all values are in the set; fail if any fall outside it.
Example Usage: Ride-sharing Platform
A ride-sharing platform tracks trip status and wants to ensure every row contains only valid, recognized status codes.
Any unrecognized status code triggers a test failure, protecting downstream dashboards from broken groupings.





