Skip to content

Commit

Permalink
fix(ingest/dbt): handle multiple owners (datahub-project#11848)
Browse files Browse the repository at this point in the history
  • Loading branch information
anshbansal authored Nov 13, 2024
1 parent 470c858 commit 8bbfa8c
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions metadata-ingestion/src/datahub/ingestion/source/dbt/dbt_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1822,16 +1822,21 @@ def _aggregate_owners(
logger.debug(
f"Owner after applying owner extraction pattern:'{self.config.owner_extraction_pattern}' is '{owner}'."
)
if self.config.strip_user_ids_from_email:
owner = owner.split("@")[0]
logger.debug(f"Owner (after stripping email):{owner}")

owner_list.append(
OwnerClass(
owner=mce_builder.make_user_urn(owner),
type=OwnershipTypeClass.DATAOWNER,
if isinstance(owner, list):
owners = owner
else:
owners = [owner]
for owner in owners:
if self.config.strip_user_ids_from_email:
owner = owner.split("@")[0]
logger.debug(f"Owner (after stripping email):{owner}")

owner_list.append(
OwnerClass(
owner=mce_builder.make_user_urn(owner),
type=OwnershipTypeClass.DATAOWNER,
)
)
)

owner_list = sorted(owner_list, key=lambda x: x.owner)
return owner_list
Expand Down

0 comments on commit 8bbfa8c

Please sign in to comment.