Skip to content

Commit

Permalink
feat(ingest): make query formatting more robust (#10678)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheth2 committed Jun 12, 2024
1 parent 05aee03 commit 1d4977c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions metadata-ingestion/src/datahub/sql_parsing/sqlglot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1d4977c

Please sign in to comment.