Skip to content

Commit

Permalink
fix: minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sagar-salvi-apptware committed Dec 16, 2024
1 parent 5feda70 commit ec202bd
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions metadata-ingestion/src/datahub/sql_parsing/tool_meta_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,17 @@ def create(
)
]

if platform_resources and len(platform_resources) > 1:
if platform_resources is None:
report.warning(
"Looker user metadata extraction failed. No Looker user ID mappings found."
)
return cls()

if len(platform_resources) > 1:
report.warning(
"Looker user metadata extraction failed. Found more than one looker user id mappings."
)
return cls()

platform_resource = platform_resources[0]

Expand All @@ -103,13 +110,10 @@ def create(
and platform_resource.resource_info.value
):
with contextlib.suppress(ValueError, AssertionError):
if platform_resource.resource_info.value.as_raw_json():
assert isinstance(
platform_resource.resource_info.value.as_raw_json(), dict
)
return cls(
looker_user_mapping=platform_resource.resource_info.value.as_raw_json()
)
value = platform_resource.resource_info.value.as_raw_json()
if value:
assert isinstance(value, dict)
return cls(looker_user_mapping=value)
return cls()

def _extract_mode_query(self, entry: QueryLog) -> bool:
Expand Down

0 comments on commit ec202bd

Please sign in to comment.