mirror of
https://github.com/datahub-project/datahub.git
synced 2025-07-03 15:17:58 +00:00
23 lines
762 B
Python
23 lines
762 B
Python
![]() |
from datahub.emitter.mce_builder import make_dataset_urn
|
||
|
|
||
|
# read-modify-write requires access to the DataHubGraph (RestEmitter is not enough)
|
||
|
from datahub.ingestion.graph.client import DatahubClientConfig, DataHubGraph
|
||
|
|
||
|
# Imports for metadata model classes
|
||
|
from datahub.metadata.schema_classes import DatasetPropertiesClass
|
||
|
|
||
|
dataset_urn = make_dataset_urn(platform="hive", name="fct_users_created", env="PROD")
|
||
|
|
||
|
gms_endpoint = "http://localhost:8080"
|
||
|
graph = DataHubGraph(DatahubClientConfig(server=gms_endpoint))
|
||
|
|
||
|
# Query multiple aspects from entity
|
||
|
result = graph.get_aspects_for_entity(
|
||
|
entity_urn=dataset_urn,
|
||
|
aspects=["datasetProperties"],
|
||
|
aspect_types=[DatasetPropertiesClass],
|
||
|
)["datasetProperties"]
|
||
|
|
||
|
if result:
|
||
|
print(result.description)
|