mirror of
				https://github.com/datahub-project/datahub.git
				synced 2025-10-31 18:59:23 +00:00 
			
		
		
		
	 8a7aeac9d9
			
		
	
	
		8a7aeac9d9
		
			
		
	
	
	
	
		
			
			Co-authored-by: socar-dini <dini@socar.kr> Co-authored-by: Shirshanka Das <shirshanka@apache.org>
		
			
				
	
	
		
			22 lines
		
	
	
		
			702 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			702 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 GlossaryTermsClass
 | |
| 
 | |
| 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=["glossaryTerms"],
 | |
|     aspect_types=[GlossaryTermsClass],
 | |
| )
 | |
| 
 | |
| print(result)
 |