Skip to content

Commit

Permalink
docs(ingest): fix error in custom tags transformer example (datahub-p…
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheth2 authored and cccs-Dustin committed Feb 1, 2023
1 parent dbdbf89 commit 6eaf3b1
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions metadata-ingestion/docs/transformer/dataset_transformer.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,22 +309,11 @@ import logging
import datahub.emitter.mce_builder as builder
from datahub.metadata.schema_classes import (
DatasetSnapshotClass,
TagAssociationClass
)
def custom_tags(current: DatasetSnapshotClass) -> List[TagAssociationClass]:
""" Returns tags to associate to a dataset depending on custom logic
This function receives a DatasetSnapshotClass, performs custom logic and returns
a list of TagAssociationClass-wrapped tags.
Args:
current (DatasetSnapshotClass): Single DatasetSnapshotClass object
Returns:
List of TagAssociationClass objects.
"""
def custom_tags(entity_urn: str) -> List[TagAssociationClass]:
"""Compute the tags to associate to a given dataset."""
tag_strings = []
Expand All @@ -335,7 +324,7 @@ def custom_tags(current: DatasetSnapshotClass) -> List[TagAssociationClass]:
tag_strings = [builder.make_tag_urn(tag=n) for n in tag_strings]
tags = [TagAssociationClass(tag=tag) for tag in tag_strings]
logging.info(f"Tagging dataset {current.urn} with {tag_strings}.")
logging.info(f"Tagging dataset {entity_urn} with {tag_strings}.")
return tags
```
Finally, you can install and use your custom transformer as [shown here](#installing-the-package).
Expand Down

0 comments on commit 6eaf3b1

Please sign in to comment.