Commit d259e91 1 parent 3c388a5 commit d259e91 Copy full SHA for d259e91
File tree 2 files changed +21
-1
lines changed
metadata-ingestion/src/datahub/ingestion
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,25 @@ def create_dataset_props_patch_builder(
78
78
return patch_builder
79
79
80
80
81
+ def check_mcp_correctness (mcp : MetadataChangeProposalClass ):
82
+ logger .debug (f"Processing as MCP with urn: { mcp .entityUrn } and aspect: { mcp .aspectName } , change type: { mcp .changeType } " )
83
+ logger .debug (f"{ mcp .aspect } " )
84
+
85
+
86
+ def check_mcpw_correctness (mcp : MetadataChangeProposalWrapper ):
87
+ logger .debug (f"Processing as MCP with urn: { mcp .entityUrn } and aspect: { mcp .aspectName } , change type: { mcp .changeType } " )
88
+ logger .debug (f"{ mcp .aspect } " )
89
+
90
+
91
+ def check_workunit_correctness (stream : Iterable [MetadataWorkUnit ]) -> Iterable [MetadataWorkUnit ]:
92
+ for wu in stream :
93
+ logger .debug (f"Checking correctnes for workunit: { wu .id } " )
94
+ if isinstance (wu .metadata , MetadataChangeProposalClass ):
95
+ check_mcp_correctness (wu .metadata )
96
+ elif isinstance (wu .metadata , MetadataChangeProposalWrapper ):
97
+ check_mcpw_correctness (wu .metadata )
98
+
99
+
81
100
def create_dataset_owners_patch_builder (
82
101
dataset_urn : str ,
83
102
ownership : Ownership ,
Original file line number Diff line number Diff line change 42
42
)
43
43
from datahub .ingestion .api .source_helpers import (
44
44
create_dataset_owners_patch_builder ,
45
- create_dataset_props_patch_builder ,
45
+ create_dataset_props_patch_builder , check_workunit_correctness ,
46
46
)
47
47
from datahub .ingestion .api .workunit import MetadataWorkUnit
48
48
from datahub .ingestion .source .aws import s3_util
@@ -260,6 +260,7 @@ def get_workunit_processors(self) -> List[Optional[MetadataWorkUnitProcessor]]:
260
260
StaleEntityRemovalHandler .create (
261
261
self , self .config , self .ctx
262
262
).workunit_processor ,
263
+ check_workunit_correctness
263
264
]
264
265
265
266
def get_workunits_internal (self ) -> Iterable [MetadataWorkUnit ]:
You can’t perform that action at this time.
0 commit comments