mirror of
https://github.com/datahub-project/datahub.git
synced 2025-06-27 05:03:31 +00:00
39 lines
962 B
Python
39 lines
962 B
Python
from datahub.metadata.urns import TagUrn
|
|
from datahub.sdk import Chart, Dashboard, DataHubClient, Dataset
|
|
|
|
client = DataHubClient.from_env()
|
|
dashboard1 = Dashboard(
|
|
name="example_dashboard_2",
|
|
platform="looker",
|
|
description="looker dashboard for production",
|
|
)
|
|
chart = Chart(
|
|
name="example_chart",
|
|
platform="looker",
|
|
description="looker chart for production",
|
|
)
|
|
|
|
input_dataset = Dataset(
|
|
name="example_dataset5",
|
|
platform="snowflake",
|
|
description="snowflake dataset for production",
|
|
)
|
|
|
|
|
|
dashboard2 = Dashboard(
|
|
name="example_dashboard",
|
|
platform="looker",
|
|
description="looker dashboard for production",
|
|
tags=[TagUrn(name="production"), TagUrn(name="data_engineering")],
|
|
input_datasets=[input_dataset.urn],
|
|
charts=[chart.urn],
|
|
dashboards=[dashboard1.urn],
|
|
)
|
|
|
|
|
|
client.entities.upsert(dashboard1)
|
|
client.entities.upsert(chart)
|
|
client.entities.upsert(input_dataset)
|
|
|
|
client.entities.upsert(dashboard2)
|