Skip to content

Commit

Permalink
Merge pull request #440 from EverythingMe/fix_ui
Browse files Browse the repository at this point in the history
Fix: python query runner didn't allow iterating lists
  • Loading branch information
arikfr committed May 31, 2015
2 parents 15ec832 + fc89bcd commit b56e87c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions redash/query_runner/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def custom_import(name, globals=None, locals=None, fromlist=(), level=0):
def custom_get_item(obj, key):
return obj[key]

def custom_get_iter(obj):
return iter(obj)

def get_query_result(query_id):
try:
query = models.Query.get_by_id(query_id)
Expand Down Expand Up @@ -143,6 +146,7 @@ def run_query(self, query):
safe_builtins["_setattr_"] = setattr
safe_builtins["setattr"] = setattr
safe_builtins["_getitem_"] = custom_get_item
safe_builtins["_getiter_"] = custom_get_iter

script_locals = { "result" : { "rows" : [], "columns" : [] } }

Expand Down

0 comments on commit b56e87c

Please sign in to comment.