Fix #19876: Snowflake Lineage Ingestion Fails Due to KeyError (#19878)

(cherry picked from commit 88f615ae4783c9e6e6bd4c200c6a7fd2200a6012)
This commit is contained in:
Mayur Singal 2025-02-20 16:26:11 +05:30 committed by OpenMetadata Release Bot
parent 6fd695f509
commit 808c18a6a0
3 changed files with 3 additions and 0 deletions

View File

@ -172,6 +172,7 @@ class LineageSource(QueryParserSource, ABC):
for row in rows:
query_dict = dict(row)
try:
query_dict.update({k.lower(): v for k, v in query_dict.items()})
yield TableQuery(
dialect=self.dialect.value,
query=query_dict["query_text"],

View File

@ -87,6 +87,7 @@ class SnowflakeLineageSource(
# further process of `yield_query_lineage`
for row in rows:
query_dict = dict(row)
query_dict.update({k.lower(): v for k, v in query_dict.items()})
try:
yield TableQuery(
dialect=self.dialect.value,

View File

@ -121,6 +121,7 @@ class UsageSource(QueryParserSource, ABC):
for row in rows:
row = dict(row)
try:
row.update({k.lower(): v for k, v in row.items()})
logger.debug(f"Processing row: {query}")
query_type = row.get("query_type")
query = self.format_query(row["query_text"])