From f6c8715356ea40b2b5ea1fbc05ba2a685977653d Mon Sep 17 00:00:00 2001 From: Kshitij Aranke Date: Tue, 3 Dec 2024 17:33:16 +0000 Subject: [PATCH] remove post_serialize and fix test --- core/dbt/contracts/graph/nodes.py | 12 ------------ tests/unit/contracts/graph/test_nodes_parsed.py | 4 ++++ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/core/dbt/contracts/graph/nodes.py b/core/dbt/contracts/graph/nodes.py index 4bb70db5d9c..9e72c107846 100644 --- a/core/dbt/contracts/graph/nodes.py +++ b/core/dbt/contracts/graph/nodes.py @@ -1441,12 +1441,6 @@ 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 @@ -1665,12 +1659,6 @@ 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/unit/contracts/graph/test_nodes_parsed.py b/tests/unit/contracts/graph/test_nodes_parsed.py index dc5a326f4d9..858716c40ba 100644 --- a/tests/unit/contracts/graph/test_nodes_parsed.py +++ b/tests/unit/contracts/graph/test_nodes_parsed.py @@ -2084,6 +2084,7 @@ def basic_parsed_exposure_dict(): "enabled": True, }, "unrendered_config": {}, + "_event_status": {}, } @@ -2104,6 +2105,7 @@ def basic_parsed_exposure_object(): tags=[], config=ExposureConfig(), unrendered_config={}, + _event_status={}, ) @@ -2139,6 +2141,7 @@ def complex_parsed_exposure_dict(): "enabled": True, }, "unrendered_config": {}, + "_event_status": {}, } @@ -2162,6 +2165,7 @@ def complex_parsed_exposure_object(): original_file_path="models/something.yml", config=ExposureConfig(), unrendered_config={}, + _event_status={}, )