Skip to content

Commit

Permalink
less confusing freshness period name
Browse files Browse the repository at this point in the history
  • Loading branch information
joellabes committed Sep 2, 2024
1 parent d9dd764 commit 603b8f7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
20 changes: 10 additions & 10 deletions schemas/latest/dbt_yml_files-latest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1246,14 +1246,23 @@
"title": "FreshnessDefinition",
"type": "object"
},
"FreshnessPeriod": {
"enum": [
"minute",
"hour",
"day"
],
"title": "FreshnessPeriod",
"type": "string"
},
"FreshnessRules": {
"additionalProperties": false,
"properties": {
"count": {
"$ref": "#/$defs/NumberOrJinjaString"
},
"period": {
"$ref": "#/$defs/Period"
"$ref": "#/$defs/FreshnessPeriod"
}
},
"required": [
Expand Down Expand Up @@ -2056,15 +2065,6 @@
"title": "OwnerWithName",
"type": "object"
},
"Period": {
"enum": [
"minute",
"hour",
"day"
],
"title": "Period",
"type": "string"
},
"PersistDocsConfig": {
"additionalProperties": false,
"properties": {
Expand Down
8 changes: 4 additions & 4 deletions src/latest/dbt_yml_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class Export(BaseModel):
config: Optional[ExportConfig] = Field(title="Export Config")


class Period(Enum):
class FreshnessPeriod(Enum):
minute = "minute"
hour = "hour"
day = "day"
Expand Down Expand Up @@ -599,7 +599,7 @@ class FreshnessRules(BaseModel):
extra="forbid",
)
count: NumberOrJinjaString
period: Period
period: FreshnessPeriod


class Grants(RootModel[Dict[str, StringOrArrayOfStrings]]):
Expand Down Expand Up @@ -828,8 +828,8 @@ class FreshnessDefinition(BaseModel):
model_config = ConfigDict(
extra="forbid",
)
warn_after: Optional[FreshnessRules] = FreshnessRules(count=1, period=Period.hour)
error_after: Optional[FreshnessRules] = FreshnessRules(count=1, period=Period.day)
warn_after: Optional[FreshnessRules] = FreshnessRules(count=1, period=FreshnessPeriod.hour)
error_after: Optional[FreshnessRules] = FreshnessRules(count=1, period=FreshnessPeriod.day)
filter: Optional[str] = ""

class SeedConfig(BaseModel):
Expand Down

0 comments on commit 603b8f7

Please sign in to comment.