Skip to content

Commit

Permalink
Various merge fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jezdez authored and Allen Short committed Mar 26, 2019
1 parent adcfc97 commit 8ee56c8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions redash/query_runner/db2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging

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

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -129,7 +129,7 @@ def run_query(self, query, user):

data = {'columns': columns, 'rows': rows}
error = None
json_data = json.dumps(data, cls=JSONEncoder)
json_data = json_dumps(data)
else:
error = 'Query completed but it returned no data.'
json_data = None
Expand Down
5 changes: 2 additions & 3 deletions redash/query_runner/kylin.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import os
import json
import logging
import requests
from requests.auth import HTTPBasicAuth

from redash import settings
from redash.query_runner import *
from redash.utils import JSONEncoder
from redash.utils import json_dumps

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -102,7 +101,7 @@ def run_query(self, query, user):
columns = self.get_columns(data['columnMetas'])
rows = self.get_rows(columns, data['results'])

return json.dumps({'columns': columns, 'rows': rows}), None
return json_dumps({'columns': columns, 'rows': rows}), None

def get_schema(self, get_stats=False):
url = self.configuration['url']
Expand Down
6 changes: 2 additions & 4 deletions redash/query_runner/rockset.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import requests
import os
from redash.query_runner import *
from redash.utils import JSONEncoder
import json
from redash.utils import json_dumps


def _get_type(value):
Expand Down Expand Up @@ -96,7 +94,7 @@ def run_query(self, query, user):
columns = []
for k in rows[0]:
columns.append({'name': k, 'friendly_name': k, 'type': _get_type(rows[0][k])})
data = json.dumps({'columns': columns, 'rows': rows}, cls=JSONEncoder)
data = json_dumps({'columns': columns, 'rows': rows})
return data, None


Expand Down
4 changes: 3 additions & 1 deletion redash/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from flask_login import current_user

from redash import models
from redash.handlers.query_results import run_query_sync
from redash.permissions import has_access, view_only
from redash.utils import json_loads
from redash.models.parameterized_query import ParameterizedQuery
Expand All @@ -31,6 +30,9 @@ def public_widget(widget):
# make sure the widget's query has a latest_query_data_id that is
# not null so public dashboards work
if q.latest_query_data_id is None:
# this import is inline since it triggers a circular
# import otherwise
from redash.handlers.query_results import run_query_sync
run_query_sync(q.data_source, {}, q.query_text)

query_data = q.latest_query_data.to_dict()
Expand Down

0 comments on commit 8ee56c8

Please sign in to comment.