feat(ingest): use node comment as description if existing else default to key (#2877)

This commit is contained in:
Remi 2021-07-16 13:54:32 -06:00 committed by GitHub
parent 3179f032de
commit 79218b1466
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,6 +68,7 @@ class DBTNode:
database: str
schema: str
name: str # name, identifier
comment: str
datahub_urn: str
@ -132,6 +133,13 @@ def extract_dbt_entities(
if "identifier" in node and not load_catalog:
name = node["identifier"]
comment = key
if key in all_catalog_entities and all_catalog_entities[key]["metadata"].get(
"comment"
):
comment = all_catalog_entities[key]["metadata"]["comment"]
materialization = None
upstream_urns = []
@ -168,6 +176,7 @@ def extract_dbt_entities(
node_type=node["resource_type"],
max_loaded_at=sources_by_id.get(key, {}).get("max_loaded_at"),
name=name,
comment=comment,
upstream_urns=upstream_urns,
materialization=materialization,
catalog_type=catalog_type,
@ -430,7 +439,7 @@ class DBTSource(Source):
)
dbt_properties = DatasetPropertiesClass(
description=node.dbt_name,
description=node.comment,
customProperties=get_custom_properties(node),
tags=[],
)