You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now that we support both constraints and tests on models, dbt can infer a primary key with the following logic:
1. Columns participating in a model-level primary key constraints
2. Columns with primary key constraints
3. Columns with unique and not_null data tests
4. Columns with enabled unique or dbt_utils.unique_combination_of_columns data tests
5. Columns with disabled unique or dbt_utils.unique_combination_of_columns data tests
Let's start by implementing this as an method to serve as a building block for downstream uses cases such as discovery (e.g. through the manifest), and maybe even sampling?
Acceptance criteria
ModelNode.infer_primary_key exists!
Suggested Tests
cases in description are covered
Impact to Other Teams
N/A
Will backports be required?
nope
Context
No response
The text was updated successfully, but these errors were encountered:
Housekeeping
Short description
Now that we support both constraints and tests on models, dbt can infer a primary key with the following logic:
1. Columns participating in a model-level primary key constraints
2. Columns with primary key constraints
3. Columns with unique and not_null data tests
4. Columns with enabled unique or dbt_utils.unique_combination_of_columns data tests
5. Columns with disabled unique or dbt_utils.unique_combination_of_columns data tests
Let's start by implementing this as an method to serve as a building block for downstream uses cases such as discovery (e.g. through the manifest), and maybe even sampling?
Acceptance criteria
Suggested Tests
Impact to Other Teams
N/A
Will backports be required?
nope
Context
No response
The text was updated successfully, but these errors were encountered: