Skip to content

Commit

Permalink
Fix: Query results in public dashboard not loading when query ends wi…
Browse files Browse the repository at this point in the history
…th semicolon
  • Loading branch information
alexStrickner00 authored and manikBS committed Aug 6, 2023
1 parent 113146e commit 7a50b18
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions redash/query_runner/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,16 +308,14 @@ def add_limit_to_query(self, query):
return str(parsed_query)

def apply_auto_limit(self, query_text, should_apply_auto_limit):
queries = split_sql_statements(query_text)
if should_apply_auto_limit:
queries = split_sql_statements(query_text)
# we only check for last one in the list because it is the one that we show result
last_query = queries[-1]
if self.query_is_select_no_limit(last_query):
queries[-1] = self.add_limit_to_query(last_query)
return combine_sql_statements(queries)
else:
return query_text

return combine_sql_statements(queries)


class BaseHTTPQueryRunner(BaseQueryRunner):
should_annotate_query = False
Expand Down

0 comments on commit 7a50b18

Please sign in to comment.