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

[Core] Snapshot config can be set in schema / properties YAML file #5627

Closed
FishtownBuildBot opened this issue Jun 7, 2024 · 3 comments · Fixed by #6206
Closed

[Core] Snapshot config can be set in schema / properties YAML file #5627

FishtownBuildBot opened this issue Jun 7, 2024 · 3 comments · Fixed by #6206
Assignees
Labels
content Improvements or additions to content dbt Core The changes proposed in this issue relate to dbt Core dbt-core v1.9 improvement Use this when an area of the docs needs improvement as it's currently unclear size: medium This change will take up to a week to address

Comments

@FishtownBuildBot
Copy link

FishtownBuildBot commented Jun 7, 2024

At a minimum, update body to include a link to the page on docs.getdbt.com requiring updates and what part(s) of the page you would like to see updated.

Issue: dbt-labs/dbt-core#4000
Pull request: dbt-labs/dbt-core#10275

On page https://docs.getdbt.com/reference/snapshot-configs, there is the line "The following resource-specific configurations are only available to Snapshots:" followed by a line with three tabs: "Project file Property file. Config block". If you click "Property file" it says: "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." This is no longer true.

There should be a block displaying the config:

snapshots:
  - name: my_snapshot
    config:
      schema: specific_schema
      unique_key: specific_id
      strategy: timestamp
      updated_at: updated_at

Note: the use of schema instead of "target_schema" is a new thing in versionless and 1.9. I'm not sure how you handle that.

Example

In Versionless and v1.9 it is possible to specify a snapshot in a SQL file and add configurations in a YAML file like below:

snapshots/orders_snapshot_file.sql

{% snapshot orders_snapshot %}
select * from {{ ref('orders') }}
{% endsnapshot %}

snapshots/_snapshots.yml or models/schema.yml or ...

snapshots:
  - name: orders_snapshot
    config:
      target_schema: test
      strategy: check
      unique_key: id
      check_cols: ['status']
@runleonarun runleonarun added content Improvements or additions to content improvement Use this when an area of the docs needs improvement as it's currently unclear dbt Core The changes proposed in this issue relate to dbt Core labels Jun 7, 2024
@nataliefiann nataliefiann added the size: medium This change will take up to a week to address label Sep 10, 2024
@nghi-ly
Copy link
Contributor

nghi-ly commented Sep 13, 2024

@nataliefiann : this might not need a docs update. please check with gerda to double-check.

@nghi-ly nghi-ly changed the title Docs Changes Needed from dbt-core Issue #4000 [Core] Docs Changes Needed from dbt-core Issue #4000 Sep 13, 2024
@nataliefiann
Copy link
Contributor

Hiya @gshank

Happy Monday - I hope you're well.

I just wanted to ask if this still needs a docs update?

Kind Regards
Natalie

@graciegoheen
Copy link
Collaborator

Yes this will need a docs update!

@graciegoheen graciegoheen changed the title [Core] Docs Changes Needed from dbt-core Issue #4000 [Core] dbt-core Issue #4000 - snapshot config can be set in schema yml file Sep 23, 2024
@dbeatty10 dbeatty10 changed the title [Core] dbt-core Issue #4000 - snapshot config can be set in schema yml file [Core] Snapshot config can be set in schema / properties YAML file Oct 1, 2024
@dbeatty10 dbeatty10 assigned dbeatty10 and unassigned gshank and graciegoheen Oct 1, 2024
dbeatty10 added a commit that referenced this issue Oct 2, 2024
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Improvements or additions to content dbt Core The changes proposed in this issue relate to dbt Core dbt-core v1.9 improvement Use this when an area of the docs needs improvement as it's currently unclear size: medium This change will take up to a week to address
Projects
None yet
7 participants