mirror of
https://github.com/apache/superset.git
synced 2026-04-25 19:14:27 +00:00
[sqllab] fix, strip comments before parsing statements (#9692)
This commit is contained in:
@@ -89,7 +89,10 @@ class ParsedQuery:
|
||||
self._limit: Optional[int] = None
|
||||
|
||||
logger.debug("Parsing with sqlparse statement: %s", self.sql)
|
||||
self._parsed = sqlparse.parse(self.stripped())
|
||||
self._parsed = sqlparse.parse(
|
||||
sqlparse.format(self.stripped(), strip_comments=True)
|
||||
)
|
||||
|
||||
for statement in self._parsed:
|
||||
self._limit = _extract_limit_from_query(statement)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user