diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/transformProps.ts b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/transformProps.ts index 54c45da1211..ac19c4e5cae 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/transformProps.ts +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/transformProps.ts @@ -736,12 +736,11 @@ const transformProps = ( | AgGridChartState | undefined; const chartStateHasFilter = !!( - chartState?.filterModel && - Object.keys(chartState.filterModel).length > 0 + chartState?.filterModel && Object.keys(chartState.filterModel).length > 0 ); if (chartStateHasFilter && savedFilterAppliedSet.has(slice_id)) { - chartState = { ...chartState, filterModel: {} as AgGridFilterModel }; + chartState = { ...chartState!, filterModel: {} as AgGridFilterModel }; } else if (chartStateHasFilter) { savedFilterAppliedSet.add(slice_id); } diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/test/buildQuery.test.ts b/superset-frontend/plugins/plugin-chart-ag-grid-table/test/buildQuery.test.ts index 39ecebf1b05..636fc190fcc 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/test/buildQuery.test.ts +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/test/buildQuery.test.ts @@ -1215,7 +1215,7 @@ describe('plugin-chart-ag-grid-table', () => { }, ).queries[0]; - expect(query.extras?.where).toBe("\"user_status\" = 'active'"); + expect(query.extras?.where).toBe('"user_status" = \'active\''); }); test('should resolve longer labels before shorter ones', () => {