Skip to content

Commit

Permalink
fix(explore): Fix datasource switch for table chart (#21544)
Browse files Browse the repository at this point in the history
  • Loading branch information
codyml committed Sep 26, 2022
1 parent b36bd3f commit 954fc89
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 954fc89

Please sign in to comment.