Skip to content

Commit

Permalink
fix: handle mixed time-series error (#16928)
Browse files Browse the repository at this point in the history
* rebase to master

* Fix line 402

Co-authored-by: yougyoung <yougyoung@pubg.com>
(cherry picked from commit 93ebe3d)
  • Loading branch information
yougyoung94 authored and villebro committed Oct 11, 2021
1 parent 768a1dc commit 457a9e7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions superset-frontend/src/chart/chartAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,13 +395,16 @@ export function exploreJSON(
.then(({ response, json }) => {
if (isFeatureEnabled(FeatureFlag.GLOBAL_ASYNC_QUERIES)) {
// deal with getChartDataRequest transforming the response data
const result = 'result' in json ? json.result[0] : json;
const result = 'result' in json ? json.result : json;
switch (response.status) {
case 200:
// Query results returned synchronously, meaning query was already cached.
return Promise.resolve([result]);
return Promise.resolve(result);
case 202:
// Query is running asynchronously and we must await the results
if (shouldUseLegacyApi(formData)) {
return waitForAsyncData(result[0]);
}
return waitForAsyncData(result);
default:
throw new Error(
Expand Down

0 comments on commit 457a9e7

Please sign in to comment.