Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loosen validation for freshness #11253

Merged
merged 2 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixes-20250128-135509.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixes
body: Loosen validation on freshness to accomodate previously wrong but harmless config.
time: 2025-01-28T13:55:09.318833-08:00
custom:
Author: ChenyuLInx peterallenwebb
Issue: "11123"
7 changes: 3 additions & 4 deletions core/dbt/artifacts/resources/v1/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
CompiledResource,
DeferRelation,
NodeVersion,
Time,
)
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
from dbt_common.dataclass_schema import ExtensibleDbtClassMixin, dbtClassMixin


@dataclass
Expand Down Expand Up @@ -42,14 +41,14 @@ class ModelFreshnessDependsOnOptions(enum.Enum):


@dataclass
class ModelBuildAfter(Time):
class ModelBuildAfter(ExtensibleDbtClassMixin):
depends_on: ModelFreshnessDependsOnOptions = ModelFreshnessDependsOnOptions.any
count: int = 0
period: TimePeriod = TimePeriod.hour


@dataclass
class ModelFreshness(dbtClassMixin):
class ModelFreshness(ExtensibleDbtClassMixin):
build_after: ModelBuildAfter = field(default_factory=ModelBuildAfter)


Expand Down
36 changes: 18 additions & 18 deletions schemas/dbt/manifest/v12.json
Original file line number Diff line number Diff line change
Expand Up @@ -4848,6 +4848,13 @@
"type": "object",
"title": "ModelBuildAfter",
"properties": {
"depends_on": {
"enum": [
"all",
"any"
],
"default": "any"
},
"count": {
"type": "integer",
"default": 0
Expand All @@ -4859,19 +4866,12 @@
"day"
],
"default": "hour"
},
"depends_on": {
"enum": [
"all",
"any"
],
"default": "any"
}
},
"additionalProperties": false
"additionalProperties": true
}
},
"additionalProperties": false
"additionalProperties": true
},
{
"type": "null"
Expand Down Expand Up @@ -14817,6 +14817,13 @@
"type": "object",
"title": "ModelBuildAfter",
"properties": {
"depends_on": {
"enum": [
"all",
"any"
],
"default": "any"
},
"count": {
"type": "integer",
"default": 0
Expand All @@ -14828,19 +14835,12 @@
"day"
],
"default": "hour"
},
"depends_on": {
"enum": [
"all",
"any"
],
"default": "any"
}
},
"additionalProperties": false
"additionalProperties": true
}
},
"additionalProperties": false
"additionalProperties": true
},
{
"type": "null"
Expand Down
Loading