0

In dbt-core, I have created a folder under snapshots called salesforce. All my snapshot sqls are in this folder. Now I have a few common configs that I have added in dbt_project.yml given below:

snapshots:
  salesforce:
    +unique_key: id
    +target_schema: snapshots
    +invalidate_hard_deletes: True

And the remaining configs in my respective sqls in config:

{{
    config(
      strategy='timestamp',
      updated_at='SYSTEM_MODSTAMP',
    )
}}

However, when I run dbt snapshot command with this setup, I get the following error:

Parsing Error at path : Snapshots must be configured with a ‘strategy’, ‘unique_key’, and ‘target_schema’.

When I dont create the salseforce folder under snapshot and add all my sqls directly under snapshot with following configuration it works.

snapshots:
   +unique_key: id
   +target_schema: snapshots
   +invalidate_hard_deletes: True

What am I missing?

1 Answer 1

1

You should provide your project name in between:

snapshots:
  project_name:
    salesforce:
      +unique_key: id
      +target_schema: snapshots
      +invalidate_hard_deletes: True
  • snapshots: — everything including packages
  • snapshots: project_name: — excluding packages
  • snapshots: project_name: subfolder: — only for a specific subfolder

The project name normally is on the top of your dbt_project.yml.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.