mirror of
				https://github.com/datahub-project/datahub.git
				synced 2025-10-31 10:49:00 +00:00 
			
		
		
		
	 8a7aeac9d9
			
		
	
	
		8a7aeac9d9
		
			
		
	
	
	
	
		
			
			Co-authored-by: socar-dini <dini@socar.kr> Co-authored-by: Shirshanka Das <shirshanka@apache.org>
		
			
				
	
	
		
			23 lines
		
	
	
		
			724 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			724 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| # read-modify-write requires access to the DataHubGraph (RestEmitter is not enough)
 | |
| from datahub.ingestion.graph.client import DatahubClientConfig, DataHubGraph
 | |
| 
 | |
| gms_endpoint = "http://localhost:8080"
 | |
| graph = DataHubGraph(DatahubClientConfig(server=gms_endpoint))
 | |
| 
 | |
| # Query multiple aspects from entity
 | |
| query = """
 | |
| mutation batchRemoveTerms {
 | |
|     batchRemoveTerms(
 | |
|       input: {
 | |
|         termUrns: ["urn:li:glossaryTerm:rateofreturn"],
 | |
|         resources: [
 | |
|           { resourceUrn:"urn:li:dataset:(urn:li:dataPlatform:hdfs,SampleHdfsDataset,PROD)"} ,
 | |
|           { resourceUrn:"urn:li:dataset:(urn:li:dataPlatform:hive,fct_users_created,PROD)"} ,]
 | |
|       }
 | |
|     )
 | |
| }
 | |
| """
 | |
| result = graph.execute_graphql(query=query)
 | |
| 
 | |
| print(result)
 |