forked from datahub-project/datahub
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'datahub-project:master' into master
- Loading branch information
Showing
31 changed files
with
493 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
metadata-ingestion/examples/library/read_lineage_datajob_rest.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from datahub.ingestion.graph.client import DatahubClientConfig, DataHubGraph | ||
|
||
# Imports for metadata model classes | ||
from datahub.metadata.schema_classes import DataJobInputOutputClass | ||
|
||
# Get the current lineage for a datajob | ||
gms_endpoint = "http://localhost:8080" | ||
graph = DataHubGraph(DatahubClientConfig(server=gms_endpoint)) | ||
|
||
urn = "urn:li:dataset:(urn:li:dataPlatform:hive,logging_events,PROD)" | ||
result = graph.get_aspect(entity_urn=urn, aspect_type=DataJobInputOutputClass) | ||
|
||
print(result) |
13 changes: 13 additions & 0 deletions
13
metadata-ingestion/examples/library/read_lineage_dataset_rest.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from datahub.ingestion.graph.client import DatahubClientConfig, DataHubGraph | ||
|
||
# Imports for metadata model classes | ||
from datahub.metadata.schema_classes import UpstreamLineageClass | ||
|
||
# Get the current lineage for a dataset | ||
gms_endpoint = "http://localhost:8080" | ||
graph = DataHubGraph(DatahubClientConfig(server=gms_endpoint)) | ||
|
||
urn = "urn:li:dataset:(urn:li:dataPlatform:hive,logging_events,PROD)" | ||
result = graph.get_aspect(entity_urn=urn, aspect_type=UpstreamLineageClass) | ||
|
||
print(result) |
44 changes: 44 additions & 0 deletions
44
metadata-ingestion/examples/library/read_lineage_execute_graphql.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# 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 = """ | ||
query scrollAcrossLineage($input: ScrollAcrossLineageInput!) { | ||
scrollAcrossLineage(input: $input) { | ||
searchResults { | ||
degree | ||
entity { | ||
urn | ||
type | ||
} | ||
} | ||
} | ||
} | ||
""" | ||
|
||
variables = { | ||
"input": { | ||
"query": "*", | ||
"urn": "urn:li:dataset:(urn:li:dataPlatform:hive,logging_events,PROD)", | ||
"count": 10, | ||
"direction": "DOWNSTREAM", | ||
"orFilters": [ | ||
{ | ||
"and": [ | ||
{ | ||
"condition": "EQUAL", | ||
"negated": "false", | ||
"field": "degree", | ||
"values": ["1", "2", "3+"], | ||
} | ||
] | ||
} | ||
], | ||
} | ||
} | ||
result = graph.execute_graphql(query=query, variables=variables) | ||
|
||
print(result) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.