fix: Bar chart crash when switching from Big Number (#34671)

This commit is contained in:
Kamil Gabryjelski
2025-08-14 15:24:23 +02:00
committed by GitHub
parent 1101182654
commit f6353bd1e8

View File

@@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import { JsonArray, t } from '@superset-ui/core';
import { ensureIsArray, JsonArray, t } from '@superset-ui/core';
import {
ControlPanelConfig,
ControlPanelsContainerProps,
@@ -343,8 +343,9 @@ const config: ControlPanelConfig = {
chartState,
) => true,
mapStateToProps: (state, controlState, chartState) => {
const value: JsonArray = state.controls.groupby
.value as JsonArray;
const value: JsonArray = ensureIsArray(
state.controls.groupby?.value,
) as JsonArray;
const valueAsStringArr: string[][] = value.map(v => {
if (v) return [v.toString(), v.toString()];
return ['', ''];