Skip to content

Commit

Permalink
fix(ingest/dbt): handle multiple owners
Browse files Browse the repository at this point in the history
  • Loading branch information
anshbansal committed Nov 13, 2024
1 parent 470c858 commit e20e3e8
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 e20e3e8

Please sign in to comment.