z3z1ma / dbt-osmosis

Provides automated YAML management, a dbt server, streamlit workbench, and git-integrated dbt model output diff tools
https://z3z1ma.github.io/dbt-osmosis/
Apache License 2.0
422 stars 45 forks source link

Feature request: apply a test to group of models #94

Open remilepriol opened 9 months ago

remilepriol commented 9 months ago

Hello,

I would like to apply some tests to a subset of my models easily. I think the programmatic handling of yaml files by dbt osmosis could enable this, for instance by specifying some tests directly in the dbt_project.yml and having them applied when running

dbt-osmosis yaml refactor

Does this idea interest other people ? could it fit in dbt-osmosis ?

syou6162 commented 9 months ago

Technically, it would not be difficult to propagate the information from the test, but it does not appear to be currently being incorporated as intended.

This is my personal opinion, but I think it is better not to incorporate it by default. It would be nice if the --add-tests option could be added.

z3z1ma commented 9 months ago

Yeah it seems a very specific situation I would want to propagate tests everywhere. Firstly the properties of columns like nullability and uniqueness may change across transformations for example during denormalization.

This would need to be opt in and I am not sure the best way other than adding a flag and leaving it to use discretion to use responsibly. Perhaps a whitelist of column.test keys which are propagatable.