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
Folks want to be able to test just their "new" data before it's inserted into their existing table. This is relevant for:
snapshots
incremental models
For example, you may want to test that your unique_key is actually unique for the "new" data. If that test fails don't insert the "new" data into the existing table.
We should create a new data test configuration to allow you to configure a given data to only run on the "new" data.
Reminds of this talk from Coalesce on how the team at Lyst did this by overwriting the incremental macro.
For the spec, I'm thinking you'd probably want to be able to test the new data in the tmp table, but also probably the final table.
For unique checks, the way I think about it is that even if you assert that your new record are in fact unique, that uniqueness might not be true when compiled with old records.
Super excited to have this for other tests though!
@graciegoheen we have built a solution in house that will test necessary data while ensuring the primary key testing is always 100% accurate, in Snowflake
The implementation varies depending on whether the incremental model:
does a merge or delete+insert where the primary key is part of the unique_key
or, does a delete+insert where the PK is not part of the unique_key or it's just an insert
It's also been built so that the user only has to add unique_test_key (i.e. the primary key) in the model config, if the unique_key isn't the primary key
So, it's all automatic
Describe the feature
A more general solution for #10236 and #10864 and dbt-labs/dbt-snowflake#1198
Folks want to be able to test just their "new" data before it's inserted into their existing table. This is relevant for:
For example, you may want to test that your
unique_key
is actually unique for the "new" data. If that test fails don't insert the "new" data into the existing table.We should create a new data test configuration to allow you to configure a given data to only run on the "new" data.
Acceptance criteria:
The text was updated successfully, but these errors were encountered: