mirror of
https://github.com/datahub-project/datahub.git
synced 2025-07-08 09:41:19 +00:00
18 lines
608 B
Python
18 lines
608 B
Python
![]() |
from datahub.metadata.urns import DatasetUrn
|
||
|
from datahub.sdk.lineage_client import LineageClient
|
||
|
from datahub.sdk.main_client import DataHubClient
|
||
|
|
||
|
client = DataHubClient.from_env()
|
||
|
lineage_client = LineageClient(client=client)
|
||
|
|
||
|
|
||
|
lineage_client.add_dataset_transform_lineage(
|
||
|
upstream=DatasetUrn(platform="snowflake", name="source_table"),
|
||
|
downstream=DatasetUrn(platform="snowflake", name="target_table"),
|
||
|
column_lineage={
|
||
|
"customer_id": ["id"],
|
||
|
"full_name": ["first_name", "last_name"],
|
||
|
},
|
||
|
)
|
||
|
# column_lineage is optional -- if not provided, table-level lineage is inferred.
|