Skip to content

Commit

Permalink
Fix functional test, remove _event_status from Exposure + Saved Query
Browse files Browse the repository at this point in the history
  • Loading branch information
aranke committed Dec 2, 2024
1 parent e6325c6 commit f41ef0b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
12 changes: 12 additions & 0 deletions core/dbt/contracts/graph/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1441,6 +1441,12 @@ def same_contents(self, old: Optional["Exposure"]) -> bool:
def group(self):
return None

def __post_serialize__(self, dct: Dict, context: Optional[Dict] = None):
dct = super().__post_serialize__(dct, context)
if "_event_status" in dct:
del dct["_event_status"]
return dct


# ====================================
# Metric node
Expand Down Expand Up @@ -1659,6 +1665,12 @@ def same_contents(self, old: Optional["SavedQuery"]) -> bool:
and True
)

def __post_serialize__(self, dct: Dict, context: Optional[Dict] = None):
dct = super().__post_serialize__(dct, context)
if "_event_status" in dct:
del dct["_event_status"]
return dct


# ====================================
# Patches
Expand Down
6 changes: 4 additions & 2 deletions tests/functional/defer_state/test_run_results_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,14 @@ def test_build_run_results_state(self, project):
results = run_dbt(
["build", "--select", "result:error+", "--state", "./state"], expect_pass=False
)
assert len(results) == 4
assert len(results) == 5
nodes = set([elem.node.name for elem in results])
assert nodes == {
"table_model",
"view_model",
"not_null_view_model_id",
"unique_view_model_id",
"my_exposure",
}

results = run_dbt(["ls", "--select", "result:error+", "--state", "./state"])
Expand Down Expand Up @@ -443,14 +444,15 @@ def test_concurrent_selectors_build_run_results_state(self, project):
["build", "--select", "state:modified+", "result:error+", "--state", "./state"],
expect_pass=False,
)
assert len(results) == 5
assert len(results) == 6
nodes = set([elem.node.name for elem in results])
assert nodes == {
"table_model_modified_example",
"view_model",
"table_model",
"not_null_view_model_id",
"unique_view_model_id",
"my_exposure",
}

self.update_view_model_failing_tests()
Expand Down

0 comments on commit f41ef0b

Please sign in to comment.