mirror of
https://github.com/datahub-project/datahub.git
synced 2025-07-19 15:42:09 +00:00
15 lines
586 B
Python
15 lines
586 B
Python
![]() |
from datahub.metadata.urns import DataFlowUrn, DataJobUrn, DatasetUrn
|
||
|
from datahub.sdk.lineage_client import LineageClient
|
||
|
from datahub.sdk.main_client import DataHubClient
|
||
|
|
||
|
client = DataHubClient.from_env()
|
||
|
lineage_client = LineageClient(client=client)
|
||
|
|
||
|
flow_urn = DataFlowUrn(orchestrator="airflow", flow_id="data_pipeline", cluster="PROD")
|
||
|
|
||
|
lineage_client.add_datajob_lineage(
|
||
|
datajob=DataJobUrn(flow=flow_urn, job_id="data_pipeline"),
|
||
|
upstreams=[DatasetUrn(platform="postgres", name="raw_data")],
|
||
|
downstreams=[DatasetUrn(platform="snowflake", name="processed_data")],
|
||
|
)
|