Skip to content

Commit

Permalink
Snapshot config can be set in schema / properties YAML file starting …
Browse files Browse the repository at this point in the history
…v1.9 (#6206)

[Preview](https://docs-getdbt-com-git-dbeatty10-patch-2-dbt-labs.vercel.app/reference/snapshot-configs)

resolves: #5627

## What are you changing in this pull request and why?

Snapshot config can be set in schema / properties YAML file starting
v1.9

## 🎩 

v1.8 and below:

<img width="600" alt="image"
src="https://github.com/user-attachments/assets/2ca8bc63-6312-4eb7-84de-5d6719a59b75">

Versionless and v1.9 and above:

<img width="600" alt="image"
src="https://github.com/user-attachments/assets/779ad6e9-359b-45a2-9117-74952e4cf299">


## Checklist
- [x] I have reviewed the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
so my content adheres to these guidelines.
- [x] The topic I'm writing about is for specific dbt version(s) and I
have versioned it according to the [version a whole
page](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
and/or [version a block of
content](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-blocks-of-content)
guidelines.
- [ ] Add a note to the prerelease version [Migration
Guide](https://github.com/dbt-labs/docs.getdbt.com/tree/current/website/docs/docs/dbt-versions/core-upgrade)

---------

Co-authored-by: Mirna Wong <[email protected]>
  • Loading branch information
dbeatty10 and mirnawong1 authored Oct 2, 2024
1 parent ea02592 commit a59ad59
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions website/docs/docs/dbt-versions/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Release notes are grouped by month for both multi-tenant and virtual private clo

## October 2024

- **Enhancement**: In dbt Cloud Versionless, snapshots defined in SQL files can now use `config` defined in `schema.yml` YAML files. This update resolves the previous limitation that required snapshot properties to be defined exclusively in `dbt_project.yml` and/or a `config()` block within the SQL file. This enhancement will be included in the upcoming dbt Core v1.9 release.
- **New:** dbt Explorer now includes trust signal icons, which is currently available as a [Preview](/docs/dbt-versions/product-lifecycles#dbt-cloud). Trust signals offer a quick, at-a-glance view of data health when browsing your dbt models in Explorer. These icons indicate whether a model is **Healthy**, **Caution**, **Degraded**, or **Unknown**. For accurate health data, ensure the resource is up-to-date and has had a recent job run. Refer to [Trust signals](/docs/collaborate/explore-projects#trust-signals-for-resources) for more information.
- **New:** Auto exposures are now available in Preview in dbt Cloud. Auto-exposures helps users understand how their models are used in downstream analytics tools to inform investments and reduce incidents. It imports and auto-generates exposures based on Tableau dashboards, with user-defined curation. To learn more, refer to [Auto exposures](/docs/collaborate/auto-exposures).

Expand Down
26 changes: 25 additions & 1 deletion website/docs/reference/snapshot-configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,31 @@ snapshots:

<TabItem value="property-yaml">

**Note:** Required snapshot properties _will not_ work when defined in `config` YAML blocks. We recommend that you define these in `dbt_project.yml` or a `config()` block within the snapshot `.sql` file.
<VersionBlock lastVersion="1.8">

**Note:** Required snapshot properties _will not_ work when only defined in `config` YAML blocks. We recommend that you define these in `dbt_project.yml` or a `config()` block within the snapshot `.sql` file or upgrade to v1.9.

</VersionBlock>

<VersionBlock firstVersion="1.9">

<File name='snapshots/schema.yml'>

```yml
snapshots:
- name: <string>
config:
database: <string>
schema: <string>
unique_key: <column_name_or_expression>
strategy: timestamp | check
updated_at: <column_name>
check_cols: [<column_name>] | all

```
</File>

</VersionBlock>

</TabItem>

Expand Down

0 comments on commit a59ad59

Please sign in to comment.