From befa7b52a03bdd47329bbef13efb03b3646af91a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Thu, 21 Nov 2024 17:06:48 -0500 Subject: [PATCH 1/9] add callout for net new --- website/docs/reference/snapshot-configs.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/website/docs/reference/snapshot-configs.md b/website/docs/reference/snapshot-configs.md index 7b3c0f8e5b..22c5ebf86c 100644 --- a/website/docs/reference/snapshot-configs.md +++ b/website/docs/reference/snapshot-configs.md @@ -13,11 +13,6 @@ import ConfigGeneral from '/snippets/_config-description-general.md'; * [Snapshots](/docs/build/snapshots) * The `dbt snapshot` [command](/reference/commands/snapshot) - ## Available configurations ### Snapshot-specific configurations @@ -125,7 +120,7 @@ snapshots: -Configurations can be applied to snapshots using the [YAML syntax](/docs/build/snapshots), available in Versionless and dbt v1.9 and higher, in the `snapshot` directory file. +Configurations can be applied to snapshots using the [YAML syntax](/docs/build/snapshots#configuring-snapshots), available in Versionless and dbt v1.9 and higher, in the `snapshot` directory file. @@ -155,6 +150,17 @@ Configurations can be applied to snapshots using the [YAML syntax](/docs/build/s +:::tip + +Configuring snapshots in YAML is recommended for new snapshot configurations. If you have existing snapshots using the `.sql` config, they'll continue to work as expected. When you're ready to migrate to YAML, we recommend: +1. Creating a backup copy of your snapshots (or using version control) +2. Converting the configurations one at a time, testing as you go +3. Using `alter` statements as needed to ensure table consistency or using a script to apply the `alter` statements + +The YAML configuration offers improved maintainability and consistency, but there's no pressure to migrate existing snapshots immediately — feel free to do so at your own pace while ensuring data quality is maintained. +::: + + + ```yaml snapshots: [](/reference/resource-configs/resource-path): @@ -256,7 +263,7 @@ snapshots: -Configurations can be applied to snapshots using [YAML syntax](/docs/build/snapshots), available in Versionless and dbt v1.9 and higher, in the `snapshot` directory file. +Configurations can be applied to snapshots using [YAML syntax](/docs/build/snapshots#configuring-snapshots), available in Versionless and dbt v1.9 and higher, in the `snapshot` directory file. From 0347fd3d174d81b5b738976b82a97e26e722bf66 Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 25 Nov 2024 16:20:27 +0000 Subject: [PATCH 2/9] turn to snippet --- website/docs/reference/snapshot-configs.md | 6 ++++-- website/snippets/_snapshots-yaml-config.md | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 website/snippets/_snapshots-yaml-config.md diff --git a/website/docs/reference/snapshot-configs.md b/website/docs/reference/snapshot-configs.md index 22c5ebf86c..4a3541c2d5 100644 --- a/website/docs/reference/snapshot-configs.md +++ b/website/docs/reference/snapshot-configs.md @@ -7,6 +7,7 @@ meta: import ConfigResource from '/snippets/_config-description-resource.md'; import ConfigGeneral from '/snippets/_config-description-general.md'; +import SnapshotsYamlConfig from '/snippets/_snapshots-yaml-config.md'; ## Related documentation @@ -120,7 +121,8 @@ snapshots: -Configurations can be applied to snapshots using the [YAML syntax](/docs/build/snapshots#configuring-snapshots), available in Versionless and dbt v1.9 and higher, in the `snapshot` directory file. + + @@ -263,7 +265,7 @@ snapshots: -Configurations can be applied to snapshots using [YAML syntax](/docs/build/snapshots#configuring-snapshots), available in Versionless and dbt v1.9 and higher, in the `snapshot` directory file. + diff --git a/website/snippets/_snapshots-yaml-config.md b/website/snippets/_snapshots-yaml-config.md new file mode 100644 index 0000000000..68ccd7c0bc --- /dev/null +++ b/website/snippets/_snapshots-yaml-config.md @@ -0,0 +1,2 @@ +Configurations can be applied to snapshots using the [YAML syntax](/docs/build/snapshots#configuring-snapshots), available in Versionless and dbt v1.9 and higher, in the `snapshot` directory file. + From 576af99f2d7654c733a884e415a3629e628ff4ae Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Mon, 25 Nov 2024 16:22:10 +0000 Subject: [PATCH 3/9] Update website/docs/reference/snapshot-configs.md Co-authored-by: Grace Goheen <53586774+graciegoheen@users.noreply.github.com> --- website/docs/reference/snapshot-configs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/snapshot-configs.md b/website/docs/reference/snapshot-configs.md index 4a3541c2d5..5f5e88c977 100644 --- a/website/docs/reference/snapshot-configs.md +++ b/website/docs/reference/snapshot-configs.md @@ -154,7 +154,7 @@ snapshots: :::tip -Configuring snapshots in YAML is recommended for new snapshot configurations. If you have existing snapshots using the `.sql` config, they'll continue to work as expected. When you're ready to migrate to YAML, we recommend: +Configuring snapshots in YAML is recommended for new snapshots. If you have existing snapshots using the `.sql` config, they'll continue to work as expected. When you're ready to migrate to YAML, we recommend: 1. Creating a backup copy of your snapshots (or using version control) 2. Converting the configurations one at a time, testing as you go 3. Using `alter` statements as needed to ensure table consistency or using a script to apply the `alter` statements From 2532cad5b35d9c6ebd0d3e8e964eb1d00ebdd34d Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Mon, 25 Nov 2024 16:24:41 +0000 Subject: [PATCH 4/9] update grace feedback --- website/docs/reference/snapshot-configs.md | 2 +- website/snippets/_snapshots-yaml-config.md | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/website/docs/reference/snapshot-configs.md b/website/docs/reference/snapshot-configs.md index 4a3541c2d5..e9ba021403 100644 --- a/website/docs/reference/snapshot-configs.md +++ b/website/docs/reference/snapshot-configs.md @@ -155,7 +155,7 @@ snapshots: :::tip Configuring snapshots in YAML is recommended for new snapshot configurations. If you have existing snapshots using the `.sql` config, they'll continue to work as expected. When you're ready to migrate to YAML, we recommend: -1. Creating a backup copy of your snapshots (or using version control) +1. Creating a backup copy of your snapshots. 2. Converting the configurations one at a time, testing as you go 3. Using `alter` statements as needed to ensure table consistency or using a script to apply the `alter` statements diff --git a/website/snippets/_snapshots-yaml-config.md b/website/snippets/_snapshots-yaml-config.md index 68ccd7c0bc..10eb8fed17 100644 --- a/website/snippets/_snapshots-yaml-config.md +++ b/website/snippets/_snapshots-yaml-config.md @@ -1,2 +1 @@ -Configurations can be applied to snapshots using the [YAML syntax](/docs/build/snapshots#configuring-snapshots), available in Versionless and dbt v1.9 and higher, in the `snapshot` directory file. - +Define snapshots using the latest [YAML syntax](/docs/build/snapshots#configuring-snapshots), available in Versionless and dbt v1.9 and higher, in the `snapshot` directory file. From 7e68e914ffcd179b0b04ff28250fec5d42c61aaa Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 27 Nov 2024 11:20:11 +0000 Subject: [PATCH 5/9] update to snapshot configs --- website/docs/reference/snapshot-configs.md | 30 ++++++++++++------- website/snippets/_snapshots-yaml-config.md | 2 +- .../components/expandable/styles.module.css | 3 +- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/website/docs/reference/snapshot-configs.md b/website/docs/reference/snapshot-configs.md index a2e8365ae9..fbcdad93d5 100644 --- a/website/docs/reference/snapshot-configs.md +++ b/website/docs/reference/snapshot-configs.md @@ -18,6 +18,7 @@ import SnapshotsYamlConfig from '/snippets/_snapshots-yaml-config.md'; ## Available configurations ### Snapshot-specific configurations + @@ -74,8 +75,9 @@ snapshots: [+](/reference/resource-configs/plus-prefix)[strategy](/reference/resource-configs/strategy): timestamp | check [+](/reference/resource-configs/plus-prefix)[updated_at](/reference/resource-configs/updated_at): [+](/reference/resource-configs/plus-prefix)[check_cols](/reference/resource-configs/check_cols): [] | all + [+](/reference/resource-configs/plus-prefix)[invalidate_hard_deletes](/reference/resource-configs/invalidate_hard_deletes) : true | false [+](/reference/resource-configs/plus-prefix)[snapshot_meta_column_names](/reference/resource-configs/snapshot_meta_column_names): {} - [+](/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): ``` @@ -108,8 +110,9 @@ snapshots: [strategy](/reference/resource-configs/strategy): timestamp | check [updated_at](/reference/resource-configs/updated_at): [check_cols](/reference/resource-configs/check_cols): [] | all - [snapshot_meta_column_names](/reference/resource-configs/snapshot_meta_column_names): {} [invalidate_hard_deletes](/reference/resource-configs/invalidate_hard_deletes) : true | false + [snapshot_meta_column_names](/reference/resource-configs/snapshot_meta_column_names): {} + [dbt_valid_to_current](/reference/resource-configs/dbt_valid_to_current): ``` @@ -147,20 +150,25 @@ snapshots: +### Snapshot configuration migration -### General configurations +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: - +#### For new snapshots +- Use the latest snapshot YAML configurations when creating new snapshots that didn't exist previously. + +#### For existing snapshots +- Migrate tables — Migrate the previous snapshot to the new table schema and values: + - Create a backup copy of your snapshots. + - Use `alter` statements as needed to ensure table consistency or use a script to apply the `alter` statements. +- New YAML config — Convert the YAML configurations one at a time, testing as you go. -:::tip +If you use one of the latest configs, such as `dbt_valid_to_current`, without migrating your data may result in mixed old and new data, leading to incorrect downstream result. -Configuring snapshots in YAML is recommended for new snapshots. If you have existing snapshots using the `.sql` config, they'll continue to work as expected. When you're ready to migrate to YAML, we recommend: -1. Creating a backup copy of your snapshots. -2. Converting the configurations one at a time, testing as you go -3. Using `alter` statements as needed to ensure table consistency or using a script to apply the `alter` statements -The YAML configuration offers improved maintainability and consistency, but there's no pressure to migrate existing snapshots immediately — feel free to do so at your own pace while ensuring data quality is maintained. -::: +### General configurations + + Date: Wed, 27 Nov 2024 15:52:47 +0000 Subject: [PATCH 6/9] Update website/docs/reference/snapshot-configs.md Co-authored-by: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> --- website/docs/reference/snapshot-configs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/snapshot-configs.md b/website/docs/reference/snapshot-configs.md index fbcdad93d5..ad74ae9d42 100644 --- a/website/docs/reference/snapshot-configs.md +++ b/website/docs/reference/snapshot-configs.md @@ -163,7 +163,7 @@ The latest snapshot YAML configurations introduced in dbt v1.9 and higher (such - Use `alter` statements as needed to ensure table consistency or use a script to apply the `alter` statements. - New YAML config — 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 may result in mixed old and new data, leading to incorrect downstream result. +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. ### General configurations From bdf2850e5d4aae38d6d5c04a790952103803d6ce Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Wed, 27 Nov 2024 15:53:03 +0000 Subject: [PATCH 7/9] Update website/docs/reference/snapshot-configs.md Co-authored-by: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> --- website/docs/reference/snapshot-configs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/snapshot-configs.md b/website/docs/reference/snapshot-configs.md index ad74ae9d42..a0edf569bf 100644 --- a/website/docs/reference/snapshot-configs.md +++ b/website/docs/reference/snapshot-configs.md @@ -160,7 +160,7 @@ The latest snapshot YAML configurations introduced in dbt v1.9 and higher (such #### For existing snapshots - Migrate tables — Migrate the previous snapshot to the new table schema and values: - Create a backup copy of your snapshots. - - Use `alter` statements as needed to ensure table consistency or use a script to apply the `alter` statements. + - Use `alter` statements as needed (or a script to apply `alter` statements) to ensure table consistency. - New YAML config — 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. From 6a84a7f955744ae9b52169acf2b9ec6a2dce532a Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Wed, 27 Nov 2024 15:53:11 +0000 Subject: [PATCH 8/9] Update website/docs/reference/snapshot-configs.md Co-authored-by: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> --- website/docs/reference/snapshot-configs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/snapshot-configs.md b/website/docs/reference/snapshot-configs.md index a0edf569bf..598a8a35aa 100644 --- a/website/docs/reference/snapshot-configs.md +++ b/website/docs/reference/snapshot-configs.md @@ -152,7 +152,7 @@ snapshots: ### 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: +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: #### For new snapshots - Use the latest snapshot YAML configurations when creating new snapshots that didn't exist previously. From 37efd7a83bf6ca39130ef66883495c5279dd2664 Mon Sep 17 00:00:00 2001 From: Mirna Wong <89008547+mirnawong1@users.noreply.github.com> Date: Wed, 27 Nov 2024 15:53:27 +0000 Subject: [PATCH 9/9] Update website/snippets/_snapshots-yaml-config.md Co-authored-by: Matt Shaver <60105315+matthewshaver@users.noreply.github.com> --- website/snippets/_snapshots-yaml-config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/snippets/_snapshots-yaml-config.md b/website/snippets/_snapshots-yaml-config.md index cdfb7ceb07..648b65752c 100644 --- a/website/snippets/_snapshots-yaml-config.md +++ b/website/snippets/_snapshots-yaml-config.md @@ -1 +1 @@ -Define snapshots using the latest [YAML configurations](/docs/build/snapshots#configuring-snapshots), available in Versionless and dbt v1.9 and higher, in the `snapshot` directory file. +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.