dbt accepted_values test failure in CI
A dbt accepted_values test found rows whose column value is not in the declared allowed set. dbt fails because the count of disallowed values is not zero.
What this error means
A dbt test step fails with "Failure in test accepted_values_<model>_<column>__<values>" and "Got N results, configured to fail if != 0".
Failure in test accepted_values_orders_status__placed__shipped__cancelled
Got 4 results, configured to fail if != 0
found status values not in ('placed','shipped','cancelled')Common causes
A new or unexpected category value appeared
Upstream data introduced a status or type value the test does not list, so those rows fail.
The accepted set is stale
A legitimate new value was added to the domain but the test was not updated to include it.
How to fix it
Inspect the unexpected values
- Run the compiled test SQL or
--store-failuresto see the offending values. - Decide whether they are bad data or a legitimate new category.
- Fix the data, or update the accepted set if the value is valid.
dbt test --select accepted_values_orders_status --store-failuresUpdate the accepted values list
When the new value is legitimate, add it to the list so the test reflects the real domain.
- accepted_values:
values: ['placed', 'shipped', 'cancelled', 'returned']How to prevent it
- Keep accepted-value lists in sync with the real domain.
- Store failures so unexpected values are visible.
- Treat new categories as a review event, not a silent pass.