Skip to content

Commit

Permalink
feat(dbt): emit browsePathsV2 for dbt nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
maiarareinaldo committed Sep 19, 2023
1 parent d848f61 commit 0c4fb3c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions metadata-ingestion/src/datahub/ingestion/source/dbt/dbt_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@
AssertionStdParametersClass,
AssertionStdParameterTypeClass,
AssertionTypeClass,
BrowsePathEntryClass,
BrowsePathsV2Class,
DataPlatformInstanceClass,
DatasetAssertionInfoClass,
DatasetAssertionScopeClass,
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0c4fb3c

Please sign in to comment.