Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenyuLInx committed Dec 19, 2024
1 parent 9df8c62 commit 4c388e4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions tests/unit/contracts/graph/test_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
"defer_relation",
"time_spine",
"batch",
"freshness",
}
)

Expand Down
13 changes: 10 additions & 3 deletions tests/unit/parser/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

from dbt import tracking
from dbt.artifacts.resources import ModelConfig, RefArgs
from dbt.artifacts.resources.v1.model import ModelBuildAfter
from dbt.artifacts.resources.v1.model import (
ModelBuildAfter,
ModelFreshnessDependsOnOptions,
)
from dbt.context.context_config import ContextConfig
from dbt.contracts.files import FileHash, FilePath, SchemaSourceFile, SourceFile
from dbt.contracts.graph.manifest import Manifest
Expand Down Expand Up @@ -728,7 +731,9 @@ def test__parse_model_freshness(self):

assert self.parser.manifest.nodes[
"model.root.my_model"
].freshness.build_after == ModelBuildAfter(count=1, period="day", depends_on="any")
].freshness.build_after == ModelBuildAfter(
count=1, period="day", depends_on=ModelFreshnessDependsOnOptions.any
)

def test__parse_model_freshness_depend_on(self):
block = self.file_block_for(SINGLE_TALBE_MODEL_FRESHNESS_ONLY_DEPEND_ON, "test_one.yml")
Expand All @@ -738,7 +743,9 @@ def test__parse_model_freshness_depend_on(self):
self.assert_has_manifest_lengths(self.parser.manifest, nodes=1)
assert self.parser.manifest.nodes[
"model.root.my_model"
].freshness.build_after == ModelBuildAfter(count=0, period="hour", depends_on="all")
].freshness.build_after == ModelBuildAfter(
count=0, period="hour", depends_on=ModelFreshnessDependsOnOptions.all
)

def test__read_basic_model_tests_wrong_severity(self):
block = self.yaml_block_for(SINGLE_TABLE_MODEL_TESTS_WRONG_SEVERITY, "test_one.yml")
Expand Down

0 comments on commit 4c388e4

Please sign in to comment.