Medium severitycompilation
Power BI Refresh Error:
DbtGenericTestClassNotFound
What does this error mean?
dbt cannot find the Python class implementing a custom generic test, either because the test class was not registered in the project or a required package providing the test is not installed.
Common causes
- 1A custom generic test references a Python class that was not created in the dbt project macros or tests directory
- 2The package providing the custom test (e.g., dbt-utils, dbt-expectations) is listed in packages.yml but dbt deps was not run
- 3The test was moved to a different package namespace and the test configuration was not updated
- 4A refactoring removed the test class file without updating all sources.yml and schema.yml references
How to fix it
- 1Step 1: Run dbt deps to ensure all packages in packages.yml are installed.
- 2Step 2: Search the project for the test name in macros/ and tests/generic/ directories to confirm the class file exists.
- 3Step 3: Check the package namespace — tests from dbt-utils use dbt_utils.<test_name> syntax.
- 4Step 4: If the test is custom, recreate the test macro in the tests/generic/ directory following the dbt generic test interface.
- 5Step 5: Run dbt compile to verify the test can be resolved before running dbt test.