Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Commit

Permalink
fix(ingest/looker): skip empty user ids for usage (datahub-project#7686)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheth2 authored and gmcgoldrick-r7 committed Mar 27, 2023
1 parent d3b2830 commit a954edf
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1067,12 +1067,13 @@ def create_looker_user(cls, raw_user: User) -> "LookerUser":
)

def get_urn(self, strip_user_ids_from_email: bool) -> Optional[str]:
if self.email is None:
user = self.email
if user and strip_user_ids_from_email:
user = user.split("@")[0]

if not user:
return None
if strip_user_ids_from_email:
return builder.make_user_urn(self.email.split("@")[0])
else:
return builder.make_user_urn(self.email)
return builder.make_user_urn(user)


@dataclass
Expand Down

0 comments on commit a954edf

Please sign in to comment.