Skip to content

Commit

Permalink
fix: don't reformat generated queries
Browse files Browse the repository at this point in the history
  • Loading branch information
betodealmeida committed Sep 20, 2024
1 parent 038ef32 commit 75d2e62
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions superset/models/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,11 @@
ColumnNotFoundException,
QueryClauseValidationException,
QueryObjectValidationError,
SupersetParseError,
SupersetSecurityException,
)
from superset.extensions import feature_flag_manager
from superset.jinja_context import BaseTemplateProcessor
from superset.sql.parse import SQLScript, SQLStatement
from superset.sql.parse import SQLScript
from superset.sql_parse import (
has_table_query,
insert_rls_in_predicate,
Expand Down Expand Up @@ -870,10 +869,6 @@ def get_query_str_extended(
sqlaq = self.get_sqla_query(**query_obj)
sql = self.database.compile_sqla_query(sqlaq.sqla_query)
sql = self._apply_cte(sql, sqlaq.cte)
try:
sql = SQLStatement(sql, engine=self.db_engine_spec.engine).format()
except SupersetParseError:
logger.warning("Unable to parse SQL to format it, passing it as-is")

if mutate:
sql = self.database.mutate_sql_based_on_config(sql)
Expand Down

0 comments on commit 75d2e62

Please sign in to comment.