mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-12 10:35:51 +00:00
fix(ingest/snowflake): parsing issues with empty queries (#13446)
This commit is contained in:
parent
035af5bdf9
commit
87199ff9d7
@ -360,6 +360,12 @@ class SnowflakeLineageExtractor(SnowflakeCommonMixin, Closeable):
|
||||
self, db_row: dict
|
||||
) -> Optional[UpstreamLineageEdge]:
|
||||
try:
|
||||
_queries = db_row.get("QUERIES")
|
||||
if _queries == "[\n {}\n]":
|
||||
# We are creating an empty object in the list when there are no queries
|
||||
# To avoid that causing a pydantic error we are setting it to an empty list
|
||||
# instead of a list with an empty object
|
||||
db_row["QUERIES"] = "[]"
|
||||
return UpstreamLineageEdge.parse_obj(db_row)
|
||||
except Exception as e:
|
||||
self.report.num_upstream_lineage_edge_parsing_failed += 1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user