Snowflake-Labs / dbt_constraints

This package generates database constraints based on the tests in a dbt project
Apache License 2.0
139 stars 27 forks source link

Exclusion of a data catalog, database, or directory from a dbt_constraint build #61

Open dontpanicmorty opened 10 months ago

dontpanicmorty commented 10 months ago

Description

The Please Note section of the dbt_constraints README.md explains that "When you add this package, dbt will automatically begin to create ... not null constraints for not_null tests." The Disabling automatic constraint generation subsection details how not null constraints can (only) be disabled for sources.

There is no functionality to disable constraint creation for other upstream model types like snapshots. Currently, my organization's dbt project has not null tests defined for most snapshots. Constraints should be created for production data through development with the option to enable and disable creating constraints for raw/source and snapshot data.