How it Works
The accepted_values test is one of dbt™'s four built-in generic tests. It validates that every value in a column belongs to a predefined list of acceptable values. This is ideal for categorical columns like status codes, types, or classifications where the full value space is known and controlled.
The quote argument (default true) controls whether values are treated as strings.
Steps and Conditions
Column Selection: Choose the column to validate.
Define Allowed Values: List acceptable values using the
valuesargument.Execution: Every row is checked against the allowed list.
Outcome: Pass if all values are in the list; fail if any unlisted values appear.
Example Usage: Order Management
An order management system uses a fixed set of statuses. The team wants to ensure no unrecognized codes enter the system.
Any order carrying an unrecognized status code will fail the test, protecting downstream logic that depends on these values.





