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

add callout for net new snapshots #6521

Open
wants to merge 26 commits into
base: current
Choose a base branch
from
Open

Conversation

mirnawong1
Copy link
Contributor

@mirnawong1 mirnawong1 commented Nov 21, 2024

Adding a callout to snapshot config page to clarify the new yaml config for net new snapshots. exisitng config snapshots can continue using config block, however added guidance on what to do if they want to migrate to new yaml spec.

Resolves #6374


🚀 Deployment available! Here are the direct links to the updated files:

@mirnawong1 mirnawong1 requested a review from a team as a code owner November 21, 2024 22:13
Copy link

vercel bot commented Nov 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
docs-getdbt-com ✅ Ready (Inspect) Visit Preview Nov 27, 2024 5:20pm

@github-actions github-actions bot added content Improvements or additions to content size: small This change will take 1 to 2 days to address Docs team Authored by the Docs team @dbt Labs labels Nov 21, 2024
Copy link
Collaborator

@graciegoheen graciegoheen left a comment

Choose a reason for hiding this comment

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

I think the original issue Doug opened was about new snapshots configs (like dbt_valid_to_current and snapshot_meta_column_names) not the "new YAML" spec - can we adjust this PR accordingly?

@mirnawong1
Copy link
Contributor Author

I think the original issue Doug opened was about new snapshots configs (like dbt_valid_to_current and snapshot_meta_column_names) not the "new YAML" spec

thanks @graciegoheen , i did meet with @dbeatty10 last week and thought he meant the new yaml spec. will loop Doug to confirm to make sure before i make further changes.

@@ -150,11 +150,27 @@ Configurations can be applied to snapshots using the [YAML syntax](/docs/build/s

</Tabs>

### Snapshot configuration migration

The latest snapshot YAML configurations introduced in dbt v1.9 and higher (such as [`snapshot_meta_column_names`](/reference/resource-configs/snapshot_meta_column_names) and [`dbt_valid_to_current`](/reference/resource-configs/dbt_valid_to_current)) are best suited for new snapshots. For existing snapshots, we recommend the following to avoid any inconsistencies to your snapshots:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

note i'm using 'latest' so it's more scalable for the long term. if i use 'new', it'll become outdated eventually i think.

[+](/reference/resource-configs/plus-prefix)[snapshot_meta_column_names](/reference/resource-configs/snapshot_meta_column_names): {<dictionary>}
[+](/reference/resource-configs/plus-prefix)[invalidate_hard_deletes](/reference/resource-configs/invalidate_hard_deletes) : true | false
[+](/reference/resource-configs/plus-prefix)[dbt_valid_to_current](/reference/resource-configs/dbt_valid_to_current): <string>
Copy link
Collaborator

Choose a reason for hiding this comment

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

dbt_valid_to_current config is available in 1.9+

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh maybe I'm not reading these version blocks right?

Copy link
Contributor

Choose a reason for hiding this comment

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

@graciegoheen You gotta expand the view so you can see line 67 / 64:

image

@@ -150,11 +150,27 @@ Configurations can be applied to snapshots using the [YAML syntax](/docs/build/s

</Tabs>

### Snapshot configuration migration

The latest snapshot YAML configurations introduced in dbt v1.9 (such as [`snapshot_meta_column_names`](/reference/resource-configs/snapshot_meta_column_names) and [`dbt_valid_to_current`](/reference/resource-configs/dbt_valid_to_current)) are best suited for new snapshots. For existing snapshots, we recommend the following to avoid any inconsistencies in your snapshots:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it's a short enough list we can just name them all - snapshot_meta_column_names, dbt_valid_to_current, hard_deletes

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, you say "For existing snapshots, we recommend the following" but then go into a list for new snapshots?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good call! I'll swap so it flows better 🙏

@@ -150,11 +150,27 @@ Configurations can be applied to snapshots using the [YAML syntax](/docs/build/s

</Tabs>

### Snapshot configuration migration

The latest snapshot YAML configurations introduced in dbt v1.9 (such as [`snapshot_meta_column_names`](/reference/resource-configs/snapshot_meta_column_names) and [`dbt_valid_to_current`](/reference/resource-configs/dbt_valid_to_current)) are best suited for new snapshots. For existing snapshots, we recommend the following to avoid any inconsistencies in your snapshots:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
The latest snapshot YAML configurations introduced in dbt v1.9 (such as [`snapshot_meta_column_names`](/reference/resource-configs/snapshot_meta_column_names) and [`dbt_valid_to_current`](/reference/resource-configs/dbt_valid_to_current)) are best suited for new snapshots. For existing snapshots, we recommend the following to avoid any inconsistencies in your snapshots:
The latest snapshot configurations introduced in dbt v1.9 (such as [`snapshot_meta_column_names`](/reference/resource-configs/snapshot_meta_column_names) and [`dbt_valid_to_current`](/reference/resource-configs/dbt_valid_to_current)) are best suited for new snapshots. For existing snapshots, we recommend the following to avoid any inconsistencies in your snapshots:

Comment on lines +157 to +158
#### For new snapshots
- Use the latest snapshot YAML configurations when creating new snapshots that didn't exist previously.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can just delete this?

- Migrate tables &mdash; Migrate the previous snapshot to the new table schema and values:
- Create a backup copy of your snapshots.
- Use `alter` statements as needed (or a script to apply `alter` statements) to ensure table consistency.
- New YAML config &mdash; Convert the YAML configurations one at a time, testing as you go.
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can just call these "new configs" we don't need to say YAML configs

- Use `alter` statements as needed (or a script to apply `alter` statements) to ensure table consistency.
- New YAML config &mdash; Convert the YAML configurations one at a time, testing as you go.

If you use one of the latest configs, such as `dbt_valid_to_current`, without migrating your data, you may have mixed old and new data, leading to an incorrect downstream result.
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this be in a warning callout?

@@ -0,0 +1 @@
Define snapshots using the latest [YAML configurations](/docs/build/snapshots#configuring-snapshots), available in Versionless dbt Cloud and Core v1.9 and higher, in the `snapshot` directory file.
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this about the YAML syntax?

I think we're getting two separate things muddied:

  • starting in 1.9 you can define snapshots in yaml
  • starting in 1.9 there are a handful of new configs that you can use, we recommend only using those configs on new snapshots or if you use them on old snapshots you will need to migrate

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 Docs team Authored by the Docs team @dbt Labs 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.

[Core] - Recommend using new snapshot configurations for net-new snapshots only
4 participants