Medium severitydata quality
Power BI Refresh Error:
UnitTestFailure
What does this error mean?
A dbt unit test failed, indicating that the SQL transformation logic in a model did not produce the expected output for the defined static input fixtures. Unit tests validate model logic before data is processed, catching regressions before they reach production tables.
Common causes
- 1The model's SQL logic was changed and no longer produces the expected output for the unit test fixtures
- 2The unit test expected values were set up for an old business rule that has since been updated
- 3A macro or variable used in the model resolves to a different value in the unit test context
- 4The unit test fixtures contain an edge case (NULL, zero, empty string) that the model does not handle correctly
- 5A ref() or source() dependency in the model was updated and changed the join or filter logic
How to fix it
- 1Run dbt test --select <model_name> --resource-type unit_test to see the expected vs. actual output.
- 2Review the unit test YAML to confirm the fixture inputs and expected outputs reflect the current business logic.
- 3If the logic change was intentional, update the expected values in the unit test YAML to match the new behavior.
- 4Add edge-case fixtures (NULL inputs, boundary values) to prevent regressions from similar data scenarios.
- 5Use dbt show --select <model_name> with the fixture inputs to debug the model output interactively.