dbt-labs / docs.getdbt.com

The code behind docs.getdbt.com
https://docs.getdbt.com/
Apache License 2.0
117 stars 921 forks source link

[Core] dbt-core Issue #10185 - new snapshot_meta_column_names config for dbt snapshots #6112

Open FishtownBuildBot opened 4 days ago

FishtownBuildBot commented 4 days ago

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. Originating from this issue: https://github.com/dbt-labs/dbt-core/issues/10185

nataliefiann commented 1 day ago

Querying here: https://dbt-labs.slack.com/archives/C044WU55X7Y/p1727180386575019

graciegoheen commented 2 hours ago

We should:

Note:

Here's an example of the new config:

{{
    config(
      target_database='analytics',
      target_schema='snapshots',
      unique_key='id',

      strategy='timestamp',
      updated_at='updated_at',

      snapshot_meta_column_names={
        dbt_valid_from: start_date,
        dbt_valid_to: end_date,
        dbt_scd_id: scd_id,
        dbt_updated_at: updated_date
      }
    )
}}

You can also set this in your dbt_project.yml like:

snapshots:
  my_project:
    +snapshot_meta_column_names={
      dbt_valid_from: start_date,
      dbt_valid_to: end_date,
      dbt_scd_id: scd_id,
      dbt_updated_at: updated_date
    }
graciegoheen commented 2 hours ago

Hi @nataliefiann I see this is "in review", but I don't see a PR linked. Lemme know when you're ready for me to take a look!