Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Front end data type display exception #6888

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
11 changes: 9 additions & 2 deletions client/app/services/query-result.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { axios } from "@/services/axios";
import { QueryResultError } from "@/services/query";
import { Auth } from "@/services/auth";
import { isString, uniqBy, each, isNumber, includes, extend, forOwn, get } from "lodash";
import JSONbig from "json-bigint";

const { parse: jsonParse } = JSONbig({ storeAsString: true });
mirkan1 marked this conversation as resolved.
Show resolved Hide resolved
const logger = debug("redash:services:QueryResult");
const filterTypes = ["filter", "multi-filter", "multiFilter"];

Expand Down Expand Up @@ -45,7 +47,10 @@ function getColumnFriendlyName(column) {

const createOrSaveUrl = data => (data.id ? `api/query_results/${data.id}` : "api/query_results");
const QueryResultResource = {
get: ({ id }) => axios.get(`api/query_results/${id}`),
get: ({ id }) =>
axios.get(`api/query_results/${id}`, {
transformResponse: response => jsonParse(response),
}),
post: data => axios.post(createOrSaveUrl(data), data),
};

Expand Down Expand Up @@ -344,7 +349,9 @@ class QueryResult {
queryResult.deferred.onStatusChange(ExecutionStatus.LOADING_RESULT);

axios
.get(`api/queries/${queryId}/results/${id}.json`)
.get(`api/queries/${queryId}/results/${id}.json`, {
transformResponse: response => jsonParse(response),
})
.then(response => {
// Success handler
queryResult.isLoadingResult = false;
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"font-awesome": "^4.7.0",
"history": "^4.10.1",
"hoist-non-react-statics": "^3.3.0",
"json-bigint": "^1.0.0",
"markdown": "0.5.0",
"material-design-iconic-font": "^2.2.0",
"mousetrap": "^1.6.1",
Expand Down Expand Up @@ -179,8 +180,8 @@
]
},
"browser": {
"fs": false,
"path": false
"fs": false,
"path": false
},
"//": "browserslist set to 'Async functions' compatibility",
"browserslist": [
Expand Down