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 5783550
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,14 @@ def create(
)
]

if platform_resources and len(platform_resources) > 1:
if platform_resources is None:
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 +107,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 5783550

Please sign in to comment.