-
Notifications
You must be signed in to change notification settings - Fork 982
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
Updated doc to show new way of defining snapshots #6157
Closed
Closed
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
4bd1ddb
Updated doc to show new way of defining snapshots
nataliefiann 43e90e5
Merge branch 'current' into nfiann-defining-snapshot
mirnawong1 2cb1e3d
Update website/docs/reference/snapshot-properties.md
nataliefiann b01fb19
Update website/docs/reference/snapshot-properties.md
nataliefiann 6b58e70
Update website/docs/reference/snapshot-properties.md
nataliefiann db2d197
Update website/docs/reference/snapshot-properties.md
nataliefiann 8147d16
Update website/docs/reference/snapshot-properties.md
nataliefiann 95888cf
Update website/docs/reference/snapshot-properties.md
nataliefiann 13729bd
Update website/docs/reference/snapshot-properties.md
nataliefiann 7b59e22
Update website/docs/reference/snapshot-properties.md
nataliefiann 8dc4f64
Update website/docs/reference/snapshot-properties.md
nataliefiann 4221586
Update website/docs/reference/snapshot-properties.md
nataliefiann 81fa93d
Update website/docs/reference/snapshot-properties.md
nataliefiann 89d4cc6
Update website/docs/reference/snapshot-properties.md
nataliefiann fef41a4
Update website/docs/reference/snapshot-properties.md
nataliefiann daa40dc
Update website/docs/reference/snapshot-properties.md
nataliefiann 2ac8abe
Update website/docs/reference/snapshot-properties.md
nataliefiann e1c78bb
Update website/docs/reference/snapshot-properties.md
nataliefiann 4f3e4d5
Update website/docs/reference/snapshot-properties.md
nataliefiann cd6c80c
Update website/docs/reference/snapshot-properties.md
nataliefiann 69586a2
Update website/docs/reference/snapshot-properties.md
nataliefiann 661cc8d
Update website/docs/reference/snapshot-properties.md
nataliefiann 7927730
Update website/docs/reference/snapshot-properties.md
nataliefiann 1563c01
Update website/docs/reference/snapshot-properties.md
nataliefiann 4d5019b
Merge branch 'current' into nfiann-defining-snapshot
nataliefiann 2333a98
Update website/docs/reference/snapshot-properties.md
nataliefiann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,3 +41,37 @@ snapshots: | |
|
||
``` | ||
</File> | ||
|
||
|
||
## Define snapshots in YAML | ||
|
||
Defining a snapshot in YAML treats snapshots as a distinct resource type, separate from models, allowing for improved organization and consistency within your code. | ||
|
||
They don't contain logic, similar to exposures, sources, and tests. To add extra logic to your snapshot, you can break it out into an ephemeral model for cleaner development and testing, and then create a snapshot of that model. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't quite true. The logic they contain is |
||
|
||
<File name='snapshots/<filename>.yml'> | ||
|
||
```yml | ||
|
||
# snapshots/my_snapshots.yml | ||
snapshots: | ||
- name: orders_snapshot | ||
relation: source('jaffle_shop', 'orders') | ||
config: | ||
schema: snapshots | ||
database: analytics | ||
unique_key: id | ||
strategy: timestamp | ||
updated_at: updated_at | ||
|
||
``` | ||
|
||
</File> | ||
In this example, the snapshot configuration tracks changes to the orders table over time. The transformation in this snapshot is: `select * from {{ source('jaffle_shop', 'orders') }}`. | ||
<VersionBlock latestVersion="1.8"> | ||
nataliefiann marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
nataliefiann marked this conversation as resolved.
Show resolved
Hide resolved
nataliefiann marked this conversation as resolved.
Show resolved
Hide resolved
nataliefiann marked this conversation as resolved.
Show resolved
Hide resolved
nataliefiann marked this conversation as resolved.
Show resolved
Hide resolved
|
||
In [dbt Cloud Versionless](/docs/dbt-versions/upgrade-dbt-version-in-cloud#versionless), you can use the new way to define snapshots in your project. This feature will also be available in the upcoming 1.9 release. | ||
|
||
nataliefiann marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
</VersionBlock> | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This makes it sound like defining snapshots in YML is what treats snapshots as a distinct resource type, which is not true.