fix(explore): Fix datasource switch for table chart (#21544)

This commit is contained in:
Cody Leff 2022-09-26 13:39:28 -04:00 committed by GitHub
parent b36bd3f083
commit 954fc89871
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}