[Bug] infer_primary_key returns an array with None
values if a node's unique
or unique_combination_of_columns
data test is misconfigured
#10983
Labels
bug
Something isn't working
Is this a new bug in dbt-core?
Current Behavior
Given a test configured on a model as:
the inferred primary_key on
model
will result in[null]
, which violates the manifest schema and may lead to parsing issues down the road: https://schemas.getdbt.com/dbt/manifest/v12/index.html#nodes_additionalProperties_anyOf_i4_primary_keyExpected Behavior
Ideally, dbt-utils can raise a parse-time error. dbt-core itself isn't in a position to validate these contracts though.
In dbt-core it'd be better to return
None
or an empty list for primary_key instead of an invalid[null]
array. dbt-core can also emit a warning log indicating the primary_key could not be inferred for a given model, even though it has aunique_combination_of_columns
test.Steps To Reproduce
in current behaviour.
Relevant log output
No response
Environment
No response
Which database adapter are you using with dbt?
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: