mirror of
https://github.com/datahub-project/datahub.git
synced 2025-09-28 18:45:02 +00:00
15 lines
437 B
Python
15 lines
437 B
Python
from datahub.sdk import DataHubClient, DatasetUrn, GlossaryTermUrn
|
|
|
|
client = DataHubClient.from_env()
|
|
|
|
dataset = client.entities.get(
|
|
DatasetUrn(platform="hive", name="realestate_db.sales", env="PROD")
|
|
)
|
|
dataset.add_term(GlossaryTermUrn("Classification.HighlyConfidential"))
|
|
|
|
# Or, if you know the term name but not the term urn:
|
|
term_urn = client.resolve.term(name="PII")
|
|
dataset.add_term(term_urn)
|
|
|
|
client.entities.update(dataset)
|