Open joshuataylor opened 3 weeks ago
Constraints support names with dbt: https://docs.getdbt.com/reference/resource-properties/constraints
Right now adding a name like this:
- name: foobar data_type: integer constraints: - type: check expression: "foobar >= 0" name: "custom_foobar_constraint"
Would result in an error like this:
10:59:21 Database Error in model fct_foobar (some_path?fct_foobar.sql) 10:59:21 new row for relation "fct_foobar__dbt_tmp" violates check constraint "fct_foobar__dbt_tmp_check" 10:59:21 DETAIL: Failing row contains (942). 10:59:21 compiled Code at target/run/fct_foobar.sql
A name is super handy for figuring out which constraint is actually failing.
dbt tests
Users of constraints.
Yes, pending decision.
Happy to contribute this, I believe it'll need to be worked out a bit, due to possible syntax changes if a name is provided.
This is a very interesting idea! I'm going to transfer to the core repository because I do believe this would need to be applied via the core codebase @dbeatty10
Is this your first time submitting a feature request?
Describe the feature
Constraints support names with dbt: https://docs.getdbt.com/reference/resource-properties/constraints
Right now adding a name like this:
Would result in an error like this:
A name is super handy for figuring out which constraint is actually failing.
Describe alternatives you've considered
dbt tests
Who will this benefit?
Users of constraints.
Are you interested in contributing this feature?
Yes, pending decision.
Anything else?
Happy to contribute this, I believe it'll need to be worked out a bit, due to possible syntax changes if a name is provided.