Hello :smiley: I am trying to insert a tag using ...
# ingestion
h
Hello 😃 I am trying to insert a tag using a Python emitter. However, even if I modify the tags of
DatasetPropertiesClass
, the tag is not entered in the Datahub. 1. If I simply append string in tags , doesn’t it get input? 2. Do I need to put urn in tags? I attach the code I used as a sample
Copy code
dataset_properties = DatasetPropertiesClass(description="This is Google Sample",
externalUrl="<https://www.google.com>", 
customProperties={},
tags = ['Active']
)

metadata_event = MetadataChangeProposalWrapper(
    entityType="dataset",
    changeType=ChangeTypeClass.UPSERT,
    entityUrn=builder.make_dataset_urn("google_sheet", "sample1"),
    aspectName="datasetProperties",
    aspect=dataset_properties,
)

emitter.emit(metadata_event)
e
Hi. This one is a deprecated field. Can you add tags through this aspect? https://github.com/linkedin/datahub/blob/master/metadata-models/src/main/pegasus/com/linkedin/common/GlobalTags.pdl It is a common aspect across all entities
👍 1
😃 1
m
@hundreds-memory-3344: you can find code examples and descriptions here -> https://datahubproject.io/docs/generated/metamodel/entities/dataset#tags-and-glossary-terms
👍 1
😃 1
h
I checked what you shared! Thank you 🙇‍♂️ I confirmed that you shared how to write a Global Tag. I tried to add tags to a specific dataset using python emitter. The way I tried was to set Tags in DatasetPropertiesClass . It is not displayed on the Datahub.
e
Yeah so the tags field in DatasetProperties is deprecated and is not used anywhere
it shows tags as just plain strings without much metadata about the tag like description
so we moved to a separate GlobalTags aspect which can be applied to all entities
that specifies the list of tag urns to attach to each entity
plus1 1
thank you 1
🙇‍♂️ 1
h
That’s different from the DatasetPropertiesClass tag I was thinking! thank you. Let’s try using global fields.