From ed673a8592406a646930b894e5ef5adb06464892 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Wed, 24 Jul 2024 09:57:12 -0700 Subject: [PATCH] Add time_spine to Model and update JSON schemas --- core/dbt/artifacts/resources/v1/model.py | 7 ++++ schemas/dbt/manifest/v12.json | 42 ++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/core/dbt/artifacts/resources/v1/model.py b/core/dbt/artifacts/resources/v1/model.py index 821d04f147f..051efc5e987 100644 --- a/core/dbt/artifacts/resources/v1/model.py +++ b/core/dbt/artifacts/resources/v1/model.py @@ -11,6 +11,7 @@ from dbt.artifacts.resources.v1.config import NodeConfig from dbt_common.contracts.config.base import MergeBehavior from dbt_common.contracts.constraints import ModelLevelConstraint +from dbt_common.dataclass_schema import dbtClassMixin @dataclass @@ -21,6 +22,11 @@ class ModelConfig(NodeConfig): ) +@dataclass +class TimeSpine(dbtClassMixin): + standard_granularity_column: str + + @dataclass class Model(CompiledResource): resource_type: Literal[NodeType.Model] @@ -32,6 +38,7 @@ class Model(CompiledResource): deprecation_date: Optional[datetime] = None defer_relation: Optional[DeferRelation] = None primary_key: List[str] = field(default_factory=list) + time_spine: Optional[TimeSpine] = None def __post_serialize__(self, dct: Dict, context: Optional[Dict] = None): dct = super().__post_serialize__(dct, context) diff --git a/schemas/dbt/manifest/v12.json b/schemas/dbt/manifest/v12.json index d133a3b55ef..6a783176003 100644 --- a/schemas/dbt/manifest/v12.json +++ b/schemas/dbt/manifest/v12.json @@ -4609,6 +4609,27 @@ "items": { "type": "string" } + }, + "time_spine": { + "anyOf": [ + { + "type": "object", + "title": "TimeSpine", + "properties": { + "standard_granularity_column": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "standard_granularity_column" + ] + }, + { + "type": "null" + } + ], + "default": null } }, "additionalProperties": false, @@ -14203,6 +14224,27 @@ "items": { "type": "string" } + }, + "time_spine": { + "anyOf": [ + { + "type": "object", + "title": "TimeSpine", + "properties": { + "standard_granularity_column": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "standard_granularity_column" + ] + }, + { + "type": "null" + } + ], + "default": null } }, "additionalProperties": false,