Skip to content

Commit

Permalink
[GDP-1363] Switch on nested meta-mapping permanently (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
YusufMahtab authored and maiarareinaldo committed Aug 22, 2023
1 parent 07e1068 commit 3f29afe
Show file tree
Hide file tree
Showing 6 changed files with 11,194 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,12 @@ def __init__(
self.source_config.tag_prefix,
"SOURCE_CONTROL",
self.source_config.strip_user_ids_from_email,
match_nested_props=True,
)
self.field_meta_processor = OperationProcessor(
self.source_config.field_meta_mapping,
self.source_config.tag_prefix,
"SOURCE_CONTROL",
self.source_config.strip_user_ids_from_email,
match_nested_props=True,
)

@classmethod
Expand Down
4 changes: 1 addition & 3 deletions metadata-ingestion/src/datahub/utilities/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,11 @@ def __init__(
tag_prefix: str = "",
owner_source_type: Optional[str] = None,
strip_owner_email_id: bool = False,
match_nested_props: bool = False,
):
self.operation_defs = operation_defs
self.tag_prefix = tag_prefix
self.strip_owner_email_id = strip_owner_email_id
self.owner_source_type = owner_source_type
self.match_nested_props = match_nested_props

def process(self, raw_props: Dict[str, Any]) -> Dict[str, Any]:
# Defining the following local variables -
Expand All @@ -127,7 +125,7 @@ def process(self, raw_props: Dict[str, Any]) -> Dict[str, Any]:
continue

raw_props_value = raw_props.get(operation_key)
if not raw_props_value and self.match_nested_props:
if not raw_props_value:
try:
raw_props_value = reduce(
operator.getitem, operation_key.split("."), raw_props
Expand Down
Loading

0 comments on commit 3f29afe

Please sign in to comment.