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

Update snapshots.md #6866

Merged
merged 6 commits into from
Feb 4, 2025
Merged

Update snapshots.md #6866

merged 6 commits into from
Feb 4, 2025

Conversation

marcelobour
Copy link
Contributor

@marcelobour marcelobour commented Feb 4, 2025

What are you changing in this pull request and why?

This PR suggests changing the example recently added to this document as the result of this Slack thread.

The key point of the original question is: "...there is a parent entity that has a “last updated” date that I need to use for new rows instead of the current timestamp. This column is present in the source data, although as it comes from the parent entity instead it can’t be used reliably to indicate changes in the source entity, but when there are changes then it can be used as the start date for those changes."

So we need to check some columns, without including anything related to update dates, and when a change is detected, we want to use our database update-related column instead of the timestamp corresponding to the snapshot execution.

The recently added example isn't incorrect, but doesn't capture what was discussed and solved in the thread, which is a more probable use case situation. Moreover, using a timestamp strategy with a properly defined updated_at field and a check strategy that only checks a column corresponding to the updated time is basically the same. I'd venture to say it could even be less efficient.

In addition to modifying the example, titles, and described logic, a summary of this use case was added to the clarifications section to serve as a reference.

Checklist

  • I have reviewed the Content style guide so my content adheres to these guidelines.
  • The topic I'm writing about is for specific dbt version(s) and I have versioned it according to the version a whole page and/or version a block of content guidelines.
  • I have added checklist item(s) to this list for anything anything that needs to happen before this PR is merged, such as "needs technical review" or "change base branch."
  • The content in this PR requires a dbt release note, so I added one to the release notes page.

It captures the key point of a recent thread on Slack.
@marcelobour marcelobour requested a review from a team as a code owner February 4, 2025 02:45
Copy link

vercel bot commented Feb 4, 2025

@marcelobour is attempting to deploy a commit to the dbt-labs Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added content Improvements or additions to content size: small This change will take 1 to 2 days to address labels Feb 4, 2025
@mirnawong1 mirnawong1 self-assigned this Feb 4, 2025
Copy link
Contributor

@mirnawong1 mirnawong1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks so much for clarifying this and correcting @marcelobour ! really appreciate it -- approved!

@mirnawong1 mirnawong1 merged commit bb9f9b4 into dbt-labs:current Feb 4, 2025
3 of 5 checks passed
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 size: small This change will take 1 to 2 days to address
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants