Skip to content

Commit

Permalink
Support multiple unique keys in snapshots (#10795)
Browse files Browse the repository at this point in the history
  • Loading branch information
gshank authored and QMalcolm committed Oct 24, 2024
1 parent bc6e334 commit d09b8b9
Show file tree
Hide file tree
Showing 6 changed files with 727 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Features-20241001-134051.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Features
body: Enable use of multi-column unique key in snapshots
time: 2024-10-01T13:40:51.297529-04:00
custom:
Author: gshank
Issue: "9992"
2 changes: 1 addition & 1 deletion core/dbt/artifacts/resources/v1/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SnapshotMetaColumnNames(dbtClassMixin):
class SnapshotConfig(NodeConfig):
materialized: str = "snapshot"
strategy: Optional[str] = None
unique_key: Optional[str] = None
unique_key: Optional[Union[str, List[str]]] = None
target_schema: Optional[str] = None
target_database: Optional[str] = None
updated_at: Optional[str] = None
Expand Down
2 changes: 1 addition & 1 deletion core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"dbt-extractor>=0.5.0,<=0.6",
"dbt-semantic-interfaces>=0.7.3,<0.8",
# Minor versions for these are expected to be backwards-compatible
"dbt-common>=1.9.0,<2.0",
"dbt-common>=1.11.0,<2.0",
"dbt-adapters>=1.7.0,<2.0",
# ----
# Expect compatibility with all new versions of these packages, so lower bounds only.
Expand Down
12 changes: 12 additions & 0 deletions schemas/dbt/manifest/v12.json
Original file line number Diff line number Diff line change
Expand Up @@ -6540,6 +6540,12 @@
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
Expand Down Expand Up @@ -16425,6 +16431,12 @@
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
},
{
"type": "null"
}
Expand Down
Loading

0 comments on commit d09b8b9

Please sign in to comment.