Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Support a list of multiple unique_keys in snapshots #6343

Open
FishtownBuildBot opened this issue Oct 23, 2024 · 2 comments · May be fixed by #6438
Open

[Core] Support a list of multiple unique_keys in snapshots #6343

FishtownBuildBot opened this issue Oct 23, 2024 · 2 comments · May be fixed by #6438
Assignees
Labels
content Improvements or additions to content dbt Core The changes proposed in this issue relate to dbt Core dbt-core v1.9 improvement Use this when an area of the docs needs improvement as it's currently unclear

Comments

@FishtownBuildBot
Copy link

FishtownBuildBot commented Oct 23, 2024

At a minimum, update body to include a link to the page on docs.getdbt.com requiring updates and what part(s) of the page you would like to see updated.
Originating from this issue: dbt-labs/dbt-core#9992
Pull request: dbt-labs/dbt-core#10795

@runleonarun runleonarun added content Improvements or additions to content improvement Use this when an area of the docs needs improvement as it's currently unclear dbt Core The changes proposed in this issue relate to dbt Core labels Oct 23, 2024
@dbeatty10 dbeatty10 changed the title [Core] Docs Changes Needed from dbt-core Issue #9992 [Core] Support a list of multiple unique_keys in snapshots Oct 23, 2024
@runleonarun runleonarun self-assigned this Oct 30, 2024
@runleonarun
Copy link
Collaborator

runleonarun commented Oct 31, 2024

Documentation plan

Use multiple unique keys

  ```
  snapshots:
    - name: orders_snapshot
      relation: source('jaffle_shop', 'orders')
      config:
        schema: snapshots
        unique_key: 
          - order_id
          - product_id
        strategy: timestamp
        updated_at: updated_at
  ```

Questions:

  1. Does this plan seem OK / solid?
  2. Does this replace concatenating columns as unique keys or is that still good practice?
  3. Can we also use inline notation for these arrays For example, unique_key [order_id, product_id] or do we prefer block notations as shown in the example above?
  4. Are multiple unique_keys backwards compatible to previous dbt versions or do I need to version these examples and content?
  5. Should I change all unique_key examples on the snapshot_configs page to become arrays? IOW, is it understood that if you use an array you can also use a string? https://docs.getdbt.com/reference/snapshot-configs

@gshank
Copy link

gshank commented Nov 1, 2024

  1. Yes.
  2. Yes, this replaces concatenating columns as unique keys
  3. The inline notation should be fine too, it's just a matter of yaml syntax style.
  4. Not backwards compatible. This is a net-new feature which is only going into 1.9 and versionless.
  5. I don't think it's necessary to change all unique_key examples, but I would probably replace the concatenating column examples. Either a string or an array is acceptable. We do this in a number of places (that I can't think of right now...)

@runleonarun runleonarun linked a pull request Nov 8, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Improvements or additions to content dbt Core The changes proposed in this issue relate to dbt Core dbt-core v1.9 improvement Use this when an area of the docs needs improvement as it's currently unclear
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants