The problem I’m having
When i configure snapshot in a yml file, I encounter an error:
raise ValidationError(
“Snapshots must be configured with a ‘strategy’ and ‘unique_key’.”
)
dbt_common.dataclass_schema.ValidationError: Snapshots must be configured with a ‘strategy’ and ‘unique_key’.
The context of why I’m trying to do this
I am using the yml method as it’s recommended in the dbt documentation vs the config method which seems to be legacy: Snapshot configurations | dbt Developer Hub
I am running:
Core:
- installed: 1.10.13
- latest: 1.10.13 - Up to date!
Plugins:
- snowflake: 1.10.2 - Up to date!
What I’ve already tried
I tried removing double quotes for my unique_key but I face the same error
Some example code or error messages
- name: my_snapshot
relation: source('my_source', 'my_table')
config:
database: my_database
schema: my_schema
strategy: check
unique_key: '"S#col_a"' #I have a column with a special character hence double quotes
check_cols:
- 'col_b'
dbt_valid_to_current: to_date('9999-12-31')
hard_deletes: new_record