dbt-coverage icon indicating copy to clipboard operation
dbt-coverage copied to clipboard

Create a new `check` command

Open aranke opened this issue 3 years ago • 5 comments

Great work on this package; I tried building something similar earlier but will go with this package instead.

The command I want to add is check, which checks that all columns referenced in YAML are present in the table.

Would this be something you'd be interested in adding to this package? If so, happy to contribute a PR.

aranke avatar Jan 29 '22 23:01 aranke

Hey @k-aranke! Thank you for the interest in the project 😊 and sorry for only replying now.

This type of check is definitely useful, I'm just wondering whether the coverage package should also measure the over-coverage. As the simplest form of implementing this, I could imagine logging a warning about such fields but I guess this is not very helpful when wanting to run this check in places where a machine needs decide whether there are no such columns (e.g. CI).

Where did you have in mind that you would use this kind of information?

sweco avatar Feb 22 '22 15:02 sweco

A friendly ping @aranke -- would you happen to be able to provide a bit more background?

mrshu avatar Nov 17 '22 19:11 mrshu

Sure, this would be really useful in CI checks to catch typos in YAML.

aranke avatar Nov 21 '22 04:11 aranke

Thanks @aranke!

I think we'd be happy to take a look at a PR if you'd be up for putting one together 🙂

mrshu avatar Nov 21 '22 09:11 mrshu

@aranke if you are looking for a quick fix, with a different sort of an approach, maybe the dbt-meta-testing package might be of some help: https://hub.getdbt.com/tnightengale/dbt_meta_testing/latest/

mrshu avatar Nov 28 '22 13:11 mrshu