From 0c4fb3c63993de739142d19525083ada7c7440d1 Mon Sep 17 00:00:00 2001 From: Maiara Reinaldo Date: Mon, 18 Sep 2023 15:25:12 +0100 Subject: [PATCH] feat(dbt): emit browsePathsV2 for dbt nodes --- .../datahub/ingestion/source/dbt/dbt_common.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/metadata-ingestion/src/datahub/ingestion/source/dbt/dbt_common.py b/metadata-ingestion/src/datahub/ingestion/source/dbt/dbt_common.py index 025ae36fec71b8..a71323924f6ad3 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/dbt/dbt_common.py +++ b/metadata-ingestion/src/datahub/ingestion/source/dbt/dbt_common.py @@ -90,6 +90,8 @@ AssertionStdParametersClass, AssertionStdParameterTypeClass, AssertionTypeClass, + BrowsePathEntryClass, + BrowsePathsV2Class, DataPlatformInstanceClass, DatasetAssertionInfoClass, DatasetAssertionScopeClass, @@ -1040,6 +1042,20 @@ def create_platform_mces( else: aspects.append(upstreams_lineage_class) + # add browsePathsV2 aspect + browse_paths_v2_path = [] + if mce_platform_instance: + platform_instance_urn = mce_builder.make_dataplatform_instance_urn( + mce_platform, mce_platform_instance + ) + browse_paths_v2_path.append( + BrowsePathEntryClass( + id=platform_instance_urn, urn=platform_instance_urn + ) + ) + browse_paths_v2_path.append(BrowsePathEntryClass(id=node.schema)) + aspects.append(BrowsePathsV2Class(path=browse_paths_v2_path)) + if len(aspects) == 0: continue dataset_snapshot = DatasetSnapshot(urn=node_datahub_urn, aspects=aspects)