diff --git a/core/dbt/contracts/graph/nodes.py b/core/dbt/contracts/graph/nodes.py index 9e72c107846..4bb70db5d9c 100644 --- a/core/dbt/contracts/graph/nodes.py +++ b/core/dbt/contracts/graph/nodes.py @@ -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 @@ -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 diff --git a/tests/functional/defer_state/test_run_results_state.py b/tests/functional/defer_state/test_run_results_state.py index e4b467d8e37..6d7e5ae3d61 100644 --- a/tests/functional/defer_state/test_run_results_state.py +++ b/tests/functional/defer_state/test_run_results_state.py @@ -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"]) @@ -443,7 +444,7 @@ 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", @@ -451,6 +452,7 @@ def test_concurrent_selectors_build_run_results_state(self, project): "table_model", "not_null_view_model_id", "unique_view_model_id", + "my_exposure", } self.update_view_model_failing_tests()