From a834b086035e4cc9d8efaa177e3a705fedd7b8b3 Mon Sep 17 00:00:00 2001 From: Eric Feng Date: Mon, 21 Nov 2016 13:13:08 -0800 Subject: [PATCH] Switching to redash.utils.json_dumps Currently, python runner is returning datetime objects as unicode strings. `redash.utils.json_dumps` returns them as native python datetime objects. --- redash/query_runner/python.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/redash/query_runner/python.py b/redash/query_runner/python.py index ec7b5bbd8c..6e54f938bd 100644 --- a/redash/query_runner/python.py +++ b/redash/query_runner/python.py @@ -4,6 +4,7 @@ import sys from redash.query_runner import * +from redash.utils import json_dumps from redash import models import importlib @@ -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