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

This commit is contained in:
Mayur Singal 2025-02-20 16:26:11 +05:30 committed by GitHub
parent e594aa3ec8
commit 88f615ae47
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 0 deletions

View File

@ -185,6 +185,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"])