dbt-project-evaluator icon indicating copy to clipboard operation
dbt-project-evaluator copied to clipboard

Include dbt_utils.unique_combination_of_columns and expression for missing_primary_key_tests

Open Kratzbaum92 opened this issue 1 year ago • 3 comments

Describe the feature

Currently the missing_primary_tests only checks for the uniqueness test of a single column.

It would be great to include these options: https://docs.getdbt.com/faqs/tests/uniqueness-two-columns

Kratzbaum92 avatar Aug 17 '22 08:08 Kratzbaum92

Hi @Kratzbaum92 and thanks for the report!

Our recommendation when the key is a combination of columns is in the vast majority of cases to create a surrogate key (SK) using the combination of columns and defining unique and not_null tests on this new column.

In your case, it would be difficult for example to test the non_null part for multiple columns to make sure that they are proper surrogate keys.

We might revisit it later but for now we are keen to keep the tests as unique and not_null.

If you want to add exceptions to the errors showing from the package you can also use the new feature that allows loading those in a seed.

b-per avatar Aug 18 '22 15:08 b-per

This came up again in #221 ! flagging this as a good issue to priortize once we an agree on a strategy here

dave-connors-3 avatar Oct 03 '22 17:10 dave-connors-3

Yep please include unique combination of columns in uniqueness, for data vault satellites its a must

TimNapierVST avatar Oct 03 '22 22:10 TimNapierVST