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

Updated doc to show new way of defining snapshots #6157

Closed
wants to merge 26 commits into from
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 Sep 26, 2024
43e90e5
Merge branch 'current' into nfiann-defining-snapshot
mirnawong1 Sep 26, 2024
2cb1e3d
Update website/docs/reference/snapshot-properties.md
nataliefiann Sep 26, 2024
b01fb19
Update website/docs/reference/snapshot-properties.md
nataliefiann Sep 26, 2024
6b58e70
Update website/docs/reference/snapshot-properties.md
nataliefiann Sep 26, 2024
db2d197
Update website/docs/reference/snapshot-properties.md
nataliefiann Sep 26, 2024
8147d16
Update website/docs/reference/snapshot-properties.md
nataliefiann Sep 26, 2024
95888cf
Update website/docs/reference/snapshot-properties.md
nataliefiann Sep 26, 2024
13729bd
Update website/docs/reference/snapshot-properties.md
nataliefiann Sep 26, 2024
7b59e22
Update website/docs/reference/snapshot-properties.md
nataliefiann Sep 26, 2024
8dc4f64
Update website/docs/reference/snapshot-properties.md
nataliefiann Sep 26, 2024
4221586
Update website/docs/reference/snapshot-properties.md
nataliefiann Sep 26, 2024
81fa93d
Update website/docs/reference/snapshot-properties.md
nataliefiann Sep 26, 2024
89d4cc6
Update website/docs/reference/snapshot-properties.md
nataliefiann Sep 30, 2024
fef41a4
Update website/docs/reference/snapshot-properties.md
nataliefiann Sep 30, 2024
daa40dc
Update website/docs/reference/snapshot-properties.md
nataliefiann Sep 30, 2024
2ac8abe
Update website/docs/reference/snapshot-properties.md
nataliefiann Sep 30, 2024
e1c78bb
Update website/docs/reference/snapshot-properties.md
nataliefiann Sep 30, 2024
4f3e4d5
Update website/docs/reference/snapshot-properties.md
nataliefiann Sep 30, 2024
cd6c80c
Update website/docs/reference/snapshot-properties.md
nataliefiann Sep 30, 2024
69586a2
Update website/docs/reference/snapshot-properties.md
nataliefiann Sep 30, 2024
661cc8d
Update website/docs/reference/snapshot-properties.md
nataliefiann Sep 30, 2024
7927730
Update website/docs/reference/snapshot-properties.md
nataliefiann Sep 30, 2024
1563c01
Update website/docs/reference/snapshot-properties.md
nataliefiann Sep 30, 2024
4d5019b
Merge branch 'current' into nfiann-defining-snapshot
nataliefiann Sep 30, 2024
2333a98
Update website/docs/reference/snapshot-properties.md
nataliefiann Sep 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions website/docs/reference/snapshot-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Collaborator

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.


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.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This isn't quite true. The logic they contain is select * from relation. Also, while exposures and sources don't have logic, tests do.


<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>

Loading