[CT-3181] [Bug] ConstraintType.custom
doesn't mix with adapter CONSTRAINT_SUPPORT
#90
Closed
2 tasks done
Labels
bug
Something isn't working
Medium Severity
bug with minor impact that does not have resolution timeframe requirement
Is this a new bug in dbt-core?
Current Behavior
ConstraintType.custom
is missing fromCONSTRAINT_SUPPORT
, leading to aKeyError
duringprocess_parsed_constraint
.We could fix this in either method, but we'll need to account for adapter-level overrides.
https://github.com/dbt-labs/dbt-core/blob/main/core/dbt/adapters/base/impl.py#L226-L232
https://github.com/dbt-labs/dbt-core/blob/eac13e3bd38b7f29401444ca77ee243ec4d8f29d/core/dbt/adapters/base/impl.py#L1441-L1462
Expected Behavior
There should not be a
KeyError
.Custom constraints should be
ConstraintSupport.NOT_ENFORCED
by default. In the future, we could maybe let users tell us if a constraint is enforced or not (i.e. whether removing that constraint constitutes a breaking change).Steps To Reproduce
It's possible to use custom constraints for any attributes that need application within the column spec of the
create table
DDL. For example, custom compression values on columns in Redshift.Relevant log output
Environment
Which database adapter are you using with dbt?
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: