-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
enhancementNew feature or requestNew feature or requestpaper_cutA small change that impacts lots of users in their day-to-dayA small change that impacts lots of users in their day-to-dayunit testsIssues related to built-in dbt unit testing functionalityIssues related to built-in dbt unit testing functionality
Milestone
Description
Is this a new bug in dbt-core?
- I believe this is a new bug in dbt-core
- I have searched the existing issues, and I could not find an existing issue for this bug
Current Behavior
If a model is set to disabled by a macro (for example the standard config macro), then the enabled status is not known at compile time, and unit tests for the model are still compiled. This causes a compilation error:
Compilation Error
'unit_test.data_staging.my_cool_report.my_cool_unit_test' depends on 'model.data_staging.my_cool_report' which is not in the graph!
Expected Behavior
Usually, if a model is disabled (i.e. enabled: false), then unit tests which test that model are not compiled.
Steps To Reproduce
- Create a model which is disabled by a macro (for example
{{config(enabled=false)}}) - Create a unit test for that model
- Run the project
Relevant log output
No response
Environment
- OS: Windows
- Python: 3.12.4
- dbt: 1.8.2Which database adapter are you using with dbt?
postgres
Additional Context
No response
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestpaper_cutA small change that impacts lots of users in their day-to-dayA small change that impacts lots of users in their day-to-dayunit testsIssues related to built-in dbt unit testing functionalityIssues related to built-in dbt unit testing functionality