diff --git a/metadata-ingestion/src/datahub/sql_parsing/sqlglot_utils.py b/metadata-ingestion/src/datahub/sql_parsing/sqlglot_utils.py index b494dde4013a4..f74a915c9fe82 100644 --- a/metadata-ingestion/src/datahub/sql_parsing/sqlglot_utils.py +++ b/metadata-ingestion/src/datahub/sql_parsing/sqlglot_utils.py @@ -315,8 +315,8 @@ def try_format_query( try: dialect = get_dialect(platform) - expression = parse_statement(expression, dialect=dialect) - return expression.sql(dialect=dialect, pretty=True) + parsed_expression = parse_statement(expression, dialect=dialect) + return parsed_expression.sql(dialect=dialect, pretty=True) except Exception as e: if raises: raise