Skip to content

Commit

Permalink
refactor(tags): Use TagUrn class when generating urn (#10786)
Browse files Browse the repository at this point in the history
Co-authored-by: Harshal Sheth <[email protected]>
  • Loading branch information
2 people authored and yoonhyejin committed Jul 16, 2024
1 parent 3f0a923 commit 27c0f4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions metadata-ingestion/src/datahub/emitter/mce_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
from datahub.utilities.urn_encoder import UrnEncoder
from datahub.utilities.urns.data_flow_urn import DataFlowUrn
from datahub.utilities.urns.dataset_urn import DatasetUrn
from datahub.utilities.urns.tag_urn import TagUrn

logger = logging.getLogger(__name__)
Aspect = TypeVar("Aspect", bound=AspectAbstract)
Expand Down Expand Up @@ -238,8 +239,7 @@ def make_tag_urn(tag: str) -> str:
"""
if tag and tag.startswith("urn:li:tag:"):
return tag
else:
return f"urn:li:tag:{tag}"
return str(TagUrn(tag))


def make_owner_urn(owner: str, owner_type: OwnerType) -> str:
Expand Down

0 comments on commit 27c0f4d

Please sign in to comment.