Skip to content

Commit

Permalink
Add time_spine to Model and update JSON schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyholcomb committed Jul 24, 2024
1 parent 3b3bba1 commit ed673a8
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/dbt/artifacts/resources/v1/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -21,6 +22,11 @@ class ModelConfig(NodeConfig):
)


@dataclass
class TimeSpine(dbtClassMixin):
standard_granularity_column: str


@dataclass
class Model(CompiledResource):
resource_type: Literal[NodeType.Model]
Expand All @@ -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)
Expand Down
42 changes: 42 additions & 0 deletions schemas/dbt/manifest/v12.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit ed673a8

Please sign in to comment.