Skip to content

Commit

Permalink
moved to use the query_runner.annotate_query flag so we won't get the…
Browse files Browse the repository at this point in the history
… SQL comment
  • Loading branch information
erans committed Mar 17, 2014
1 parent 96d6f6f commit 642a2b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions data/query_runner_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ def query_runner(query):
json_data = None
error = None

# Remove the SQL comment that Redash adds
if query.find("/*") > -1 and query.find("*/") > -1:
query = query[query.find("*/")+3:]

# Poor man's protection against running scripts from output the scripts directory
if connection_string.find("../") > -1:
return None, "Scripts can only be run from the configured scripts directory"
Expand Down Expand Up @@ -48,4 +44,5 @@ def query_runner(query):

return json_data, error

query_runner.annotate_query = False
return query_runner
5 changes: 1 addition & 4 deletions data/query_runner_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ def query_runner(query):

query = query.strip()

# Remove the SQL comment that Redash adds
if query.find("/*") > -1 and query.find("*/") > -1:
query = query[query.find("*/")+3:]

if base_url is not None and base_url != "":
if query.find("://") > -1:
return None, "Accepting only relative URLs to '%s'" % base_url
Expand All @@ -45,4 +41,5 @@ def query_runner(query):

return json_data, error

query_runner.annotate_query = False
return query_runner

0 comments on commit 642a2b6

Please sign in to comment.