mirror of
https://github.com/datahub-project/datahub.git
synced 2025-08-03 14:57:53 +00:00
44 lines
1.0 KiB
Python
44 lines
1.0 KiB
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 searchAcrossLineage {
|
|
searchAcrossLineage(
|
|
input: {
|
|
query: "*"
|
|
urn: "urn:li:dataset:(urn:li:dataPlatform:dbt,long_tail_companions.adoption.human_profiles,PROD)"
|
|
start: 0
|
|
count: 10
|
|
direction: DOWNSTREAM
|
|
orFilters: [
|
|
{
|
|
and: [
|
|
{
|
|
condition: EQUAL
|
|
negated: false
|
|
field: "degree"
|
|
values: ["1", "2", "3+"]
|
|
}
|
|
] # Additional search filters can be included here as well
|
|
}
|
|
]
|
|
}
|
|
) {
|
|
searchResults {
|
|
degree
|
|
entity {
|
|
urn
|
|
type
|
|
}
|
|
}
|
|
}
|
|
}
|
|
"""
|
|
result = graph.execute_graphql(query=query)
|
|
|
|
print(result)
|