-
Notifications
You must be signed in to change notification settings - Fork 984
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
New snapshot configs #5817
New snapshot configs #5817
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
website/docs/docs/build/snapshots.md
Outdated
| ------ | ----------- | --------- | ------- | | ||
| Config | Description | Required? | Example | | ||
| ------ | ----------- | --------- | ------- | | ||
| [database] | The database that dbt should render the snapshot table into | No | analytics | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the target_database
and target_schema
pages no longer apply, is there anything specific we want to link to here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
website/docs/docs/build/snapshots.md
Outdated
{{ | ||
config( | ||
unique_key='id', | ||
schema='snapshots', // optional config. If not defined, the snapshot will use the `generate_schema_name` macro. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
schema
and database
are the new configs that use the generate_schema_name
/ generate_database_name
macros like other dbt resources
target_schema
and target_database
are the old configs
|
||
:::warning Legacy configuration | ||
|
||
For environments on versionless dbt Cloud or dbt Core v1.9+, the `target_database` configuration is now optional. Best practices dictate that the `target_database` config should be removed from snapshots in the environment, in which case the snapshots will instead utilize the `generate_database_name` macro by default. Project snapshots configured with `target_schema` will continue to work as expected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe target_database
has always been optional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
::: | ||
|
||
</VersionBlock> | ||
|
||
Snapshots build into the same `target_schema`, no matter who is running them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we just remove this page all-together? This information is now out-dated
Could we also add snapshot config examples:
|
Can we also make some updates to this page: |
I think the doc changes are more work than the code changes were :). Looks like Grace has this pretty much handled. |
😂 |
I think it may also be worth calling this out in a release note? Thoughts? |
Co-authored-by: Grace Goheen <[email protected]>
Co-authored-by: Grace Goheen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! left some minor nits
Co-authored-by: Ly Nguyen <[email protected]>
website/docs/docs/build/snapshots.md
Outdated
|
||
</File> | ||
|
||
6. Run the `dbt snapshot` [command](/reference/commands/snapshot) — for our example, a new table will be created at `analytics.snapshots.orders_snapshot`. The `schema` config will utilize the `generate_schema_name` macro. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we link to this page for the schema
config mention https://docs.getdbt.com/reference/resource-configs/schema
</File> | ||
|
||
</VersionBlock> | ||
|
||
#### Snapshot Configuration | ||
|
||
| Option | Description | Required? | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this table? It seems duplicative of the other table here -> https://docs.getdbt.com/docs/build/snapshots#snapshot-configurations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, can remove and link to snapshots page instead!
|
||
<VersionBlock lastVersion="1.8"> | ||
|
||
Available for versionless dbt Cloud or dbt Core v1.9+. Select v1.9 or newer from the version dropdown to view the configs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirming are we calling this "versionless" or "Keep on latest version"? cc: @jtcohen6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question - we went back earlier this quarter and added "versionless" in front of every mention of "Keep on latest version" in the docs to tie the two ideas together but I'll defer to Jerco about how to handle the naming going forward
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh if that's already added, then that works for me!
@@ -4,6 +4,12 @@ description: "Target_database - Read this in-depth guide to learn about configur | |||
datatype: string | |||
--- | |||
|
|||
:::note | |||
|
|||
For [versionless](/docs/dbt-versions/core-upgrade/upgrading-to-v1.8#keep-on-latest-version) dbt Cloud accounts and dbt Core v1.9+, this functionality is no longer utilized. Use the [database](/reference/resource-configs/database) config as an alternative to define a custom database while still respecting the `generate_database_name` macro. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question on "versionless"
|
||
<VersionBlock lastVersion="1.8"> | ||
|
||
Available for versionless dbt Cloud or dbt Core v1.9+. Select v1.9 or newer from the version dropdown to view the configs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question on "versionless"
@@ -4,6 +4,12 @@ description: "Target_schema - Read this in-depth guide to learn about configurat | |||
datatype: string | |||
--- | |||
|
|||
:::note | |||
|
|||
For [versionless](/docs/dbt-versions/core-upgrade/upgrading-to-v1.8#keep-on-latest-version) dbt Cloud accounts and dbt Core v1.9+, this functionality is no longer required. Use the [schema](/reference/resource-configs/schema) config as an alternative to define a custom schema while still respecting the `generate_schema_name` macro. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question on "versionless"
^ @matthewshaver just want to make sure we get these updates in as well! |
Co-authored-by: Grace Goheen <[email protected]>
Co-authored-by: Grace Goheen <[email protected]>
Updating based on feedback
Replacing table with link
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for all of the work on this!
What are you changing in this pull request and why?
Closes #5805
[First round of updates]
Adds notes to the
target_schema
andtarget_database
that the configs are optionalSnapshot page examples and tables updated with new examples and table configs
Checklist
Adding or removing pages (delete if not applicable):
website/sidebars.js
website/vercel.json
npm run build
to update the links that point to deleted pages