dbt run, test, seed, etc. counts exclude disabled models but include tests that depend on disabled models
See original GitHub issueDescribe the bug
When running dbt compile, dbt run, dbt test, etc., a count of objects in the dbt project are provided, like this:
Found 45 models, 252 tests, 0 snapshots, 0 analyses, 123 macros, 0 operations, 0 seed files, 57 sources
This count excludes dbt models which are disabled, but includes tests which depend on disabled models. This is confusing and inconsistent.
Steps To Reproduce
Create a model and some associated schema tests that are related to the model. Execute dbt compile
and look at the counts for the models and tests in the project, e.g.
Found 45 models, 252 tests, 0 snapshots, 0 analyses, 123 macros, 0 operations, 0 seed files, 57 sources
Disable the model. Run dbt compile
and observe the number of objects associated with the project. The number of models will have decreased by one but the number of tests will have remained constant even though some of the tests depend on the disabled model, e.g.:
Found 44 models, 252 tests, 0 snapshots, 0 analyses, 123 macros, 0 operations, 0 seed files, 57 sources
Expected behavior
The more immediate behavior to fix the bug would be to exclude tests that are disabled from the count of objects generated from dbt commands. So in the scenario above, assuming that two tests depend on the disabled model, the count of objects after disabling the model should exclude these two tests and be:
Found 44 models, 250 tests, 0 snapshots, 0 analyses, 123 macros, 0 operations, 0 seed files, 57 sources
A more helpful longer-term approach might be to include and count both enabled and disabled objects, such as:
Found 44 enabled models, 1 disabled model, 250 enabled tests, 2 disabled tests, 0 snapshots, 0 analyses, 123 macros, 0 operations, 0 seed files, 57 sources
I understand that there are a lot of mechanical reasons why it is difficult to count disabled models. But given that disabled tests are already being lumped in with enabled tests in the counts, it should hopefully not be that hard to at least call out the number of enabled vs. disabled tests as per the following:
Found 44 models, 250 enabled tests, 2 disabled tests, 0 snapshots, 0 analyses, 123 macros, 0 operations, 0 seed files, 57 sources
Screenshots and log output
Already above.
System information
Which database are you using dbt with? Snowflake
The output of dbt --version
:
installed version: 0.14.2
latest version: 0.14.2
Up to date!
The operating system you’re using: Mac OS Mojave 10.14.5
The output of python --version
:
Python 2.7.10
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
@drewbanin Submitted a PR here: https://github.com/fishtown-analytics/dbt/pull/2026
closed by #2026