Skip to content

Commit

Permalink
Testing for uniqueness prior to snapshots (#4857)
Browse files Browse the repository at this point in the history
[Preview](https://docs-getdbt-com-git-dbeatty-snapshots-testing-u-736c54-dbt-labs.vercel.app/reference/resource-configs/unique_key)

## What are you changing in this pull request and why?

We recommend testing for uniqueness of the `unique_key` prior to running
a snapshot. This PR adds a [link](#how-to-test-primary-keys-with-dbt) to
show precisely how to do that.

## Checklist
- [x] Review the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
so my content adheres to these guidelines.
  • Loading branch information
mirnawong1 authored Feb 5, 2024
2 parents b5f020b + 3b63d31 commit 9cd9718
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion website/docs/reference/resource-configs/unique_key.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ A column name or expression that is unique for the inputs of a snapshot. dbt use

:::caution

Providing a non-unique key will result in unexpected snapshot results. dbt **will not** test the uniqueness of this key, consider adding a test to your project to ensure that this key is indeed unique.
Providing a non-unique key will result in unexpected snapshot results. dbt **will not** test the uniqueness of this key, consider [testing](/blog/primary-key-testing#how-to-test-primary-keys-with-dbt) the source data to ensure that this key is indeed unique.

:::

Expand Down

0 comments on commit 9cd9718

Please sign in to comment.