Open lhz opened 1 month ago
Hey @lhz, thanks for opening this issue! I agree, this is something that needs to be added. We are planning to work on it soon, but you are of course welcome to contribute as well.
I think the most important features to include are:
failing
models: my idea would be to use the configuration variable fail_any_model_under
: https://dbt-score.picnic.tech/configuration/#main-configuration. Do you think that would work for your use-case as well?violated
rulesThese two options then can be combined to get: all models with all rules, all models showing only their failing rules, failing models with their failing rules and failing models with all their passing rules. (last option will probably never be used though :grin: )
As a workaround, you could also achieve this by using --format json
and jq
.
For a threshold that's e.g. 7.7
:
dbt-score lint --format json | jq -r '.models | to_entries[] | select(.value.score < 7.7) | .key
or to get all failing models
dbt-score lint --format json | jq -r '.models | to_entries[] | select(.value.pass|not) | .key
We are mostly interested in knowing which models are not up to standard, and that can be hard to glimpse when the project has many models and most of them already have a gold badge.
It would be very useful to have an option for the
lint
command that will cause it to only output models whose score is less than the first threshold (or perhaps more flexible, a custom threshold given as argument to the option.)Related to this, it would also be useful to output only the rules that were not satisfied, but I'm unsure if that should be a separate option or a direct result of the one suggested.