Skip to content

Commit

Permalink
Switching to redash.utils.json_dumps
Browse files Browse the repository at this point in the history
Currently, python runner is returning datetime objects as unicode strings. `redash.utils.json_dumps` returns them as native python datetime objects.
  • Loading branch information
ehfeng authored Nov 21, 2016
1 parent ffb60ec commit 3532890
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion query_runner/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import sys

from redash.query_runner import *
from redash.utils import json_dumps
from redash import models

import importlib
Expand Down Expand Up @@ -228,7 +229,7 @@ def run_query(self, query, user):

result = self._script_locals['result']
result['log'] = self._custom_print.lines
json_data = json.dumps(result)
json_data = json_dumps(result)
except KeyboardInterrupt:
error = "Query cancelled by user."
json_data = None
Expand Down

0 comments on commit 3532890

Please sign in to comment.