Fix #2524: Ingestion: DBT model parsing fails with column (#2525) (#2639)

This commit is contained in:
Sriharsha Chintalapani 2022-02-06 12:49:57 -08:00 committed by GitHub
parent 5efd00135c
commit ceeefb40be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -394,6 +394,7 @@ class SQLSource(Source[OMetaDatabaseAndTable]):
manifest_columns = mnode.get("columns", {})
for key in ccolumns:
ccolumn = ccolumns[key]
col_name = ccolumn["name"].lower().replace(".", "_DOT_")
try:
ctype = ccolumn["type"]
col_type = ColumnTypeParser.get_column_type(ctype)
@ -403,7 +404,7 @@ class SQLSource(Source[OMetaDatabaseAndTable]):
if description is None:
description = ccolumn.get("comment", None)
col = Column(
name=ccolumn["name"].lower(),
name=col_name,
description=description,
dataType=col_type,
dataLength=1,
@ -411,7 +412,7 @@ class SQLSource(Source[OMetaDatabaseAndTable]):
)
columns.append(col)
except Exception as err: # pylint: disable=broad-except
logger.error(f"Failed to parse column type due to {err}")
logger.error(f"Failed to parse column {col_name} due to {err}")
return columns