You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ji...@apache.org on 2022/09/26 17:39:49 UTC

[superset] branch master updated: fix(explore): Fix datasource switch for table chart (#21544)

This is an automated email from the ASF dual-hosted git repository.

jinghuayao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 954fc89871 fix(explore): Fix datasource switch for table chart (#21544)
954fc89871 is described below

commit 954fc89871d26d4041247739d37b4ae2988069f6
Author: Cody Leff <co...@preset.io>
AuthorDate: Mon Sep 26 13:39:28 2022 -0400

    fix(explore): Fix datasource switch for table chart (#21544)
---
 .../controlUtils/getControlValuesCompatibleWithDatasource.ts  | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/superset-frontend/src/explore/controlUtils/getControlValuesCompatibleWithDatasource.ts b/superset-frontend/src/explore/controlUtils/getControlValuesCompatibleWithDatasource.ts
index 346768557c..98590e63ee 100644
--- a/superset-frontend/src/explore/controlUtils/getControlValuesCompatibleWithDatasource.ts
+++ b/superset-frontend/src/explore/controlUtils/getControlValuesCompatibleWithDatasource.ts
@@ -36,11 +36,12 @@ const isControlValueCompatibleWithDatasource = (
 ) => {
   if (controlState.options && typeof value === 'string') {
     if (
-      (Array.isArray(controlState.options) &&
-        controlState.options.some(
-          (option: [string | number, string]) => option[0] === value,
-        )) ||
-      value in controlState.options
+      controlState.options.some(
+        (option: [string | number, string] | { column_name: string }) =>
+          Array.isArray(option)
+            ? option[0] === value
+            : option.column_name === value,
+      )
     ) {
       return datasource.columns.some(column => column.column_name === value);
     }