diff --git a/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx b/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx index 00fb45150e2..1b9c77c33ee 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx @@ -533,7 +533,12 @@ export default function TableChart( // so that cross-filters work on the receiving chart const resolvedCol = columnLabelToNameMap[col] ?? col; const val = ensureIsArray(updatedFilters?.[col]); - if (!val.length || val[0] === null || (val[0] instanceof DateWithFormatter && val[0].input === null)) + if ( + !val.length || + val[0] === null || + (val[0] instanceof DateWithFormatter && + val[0].input === null) + ) return { col: resolvedCol, op: 'IS NULL' as const, @@ -646,24 +651,22 @@ export default function TableChart( // DateWithFormatter objects wrap nulls, so we must check both if ( dataRecordValue == null || - (dataRecordValue instanceof DateWithFormatter && dataRecordValue.input == null) + (dataRecordValue instanceof DateWithFormatter && + dataRecordValue.input == null) ) { drillToDetailFilters.push({ col: col.key, op: 'IS NULL' as any, val: null, }); - } else if (col.dataType === GenericDataType.Temporal && timeGrain) { const startTime = dataRecordValue instanceof Date ? dataRecordValue : new Date(dataRecordValue as string | number); - const [rangeStartTime, rangeEndTime] = getTimeRangeFromGranularity( - startTime, - timeGrain, - ); + const [rangeStartTime, rangeEndTime] = + getTimeRangeFromGranularity(startTime, timeGrain); const timeRangeValue = `${rangeStartTime.toISOString()} : ${rangeEndTime.toISOString()}`; drillToDetailFilters.push({ @@ -696,7 +699,11 @@ export default function TableChart( filters: [ { col: cellPoint.key, - op: (cellPoint.value == null || (cellPoint.value instanceof DateWithFormatter && cellPoint.value.input == null) ? 'IS NULL' : '==') as any, + op: (cellPoint.value == null || + (cellPoint.value instanceof DateWithFormatter && + cellPoint.value.input == null) + ? 'IS NULL' + : '==') as any, val: extractTextFromHTML(cellPoint.value), }, ], diff --git a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigConstants.test.tsx b/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigConstants.test.tsx index 8d09344a15d..473a81d1de7 100644 --- a/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigConstants.test.tsx +++ b/superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigConstants.test.tsx @@ -19,8 +19,7 @@ import { SHARED_COLUMN_CONFIG_PROPS } from './constants'; -const tokenSeparators = - SHARED_COLUMN_CONFIG_PROPS.d3NumberFormat.tokenSeparators; +const { tokenSeparators } = SHARED_COLUMN_CONFIG_PROPS.d3NumberFormat; test('should allow commas in D3 format inputs', () => { expect(tokenSeparators).toBeDefined(); diff --git a/tests/integration_tests/charts/data/api_tests.py b/tests/integration_tests/charts/data/api_tests.py index 8b5eb9f91c6..989050657e6 100644 --- a/tests/integration_tests/charts/data/api_tests.py +++ b/tests/integration_tests/charts/data/api_tests.py @@ -1181,7 +1181,7 @@ class TestGetChartDataApi(BaseTestChartDataApi): } @pytest.mark.usefixtures("load_birth_names_dashboard_with_slices") - @with_config(QUERY_CONTEXT_SIDECAR_URL="http://sidecar.internal") + @with_config({"QUERY_CONTEXT_SIDECAR_URL": "http://sidecar.internal"}) @mock.patch("superset.charts.data.api.ChartDataRestApi._get_data_response") @mock.patch("superset.charts.data.api.ChartDataCommand.validate") @mock.patch( @@ -1226,7 +1226,7 @@ class TestGetChartDataApi(BaseTestChartDataApi): } @pytest.mark.usefixtures("load_birth_names_dashboard_with_slices") - @with_config(QUERY_CONTEXT_SIDECAR_URL="http://sidecar.internal") + @with_config({"QUERY_CONTEXT_SIDECAR_URL": "http://sidecar.internal"}) @mock.patch("superset.charts.data.api.ChartDataRestApi._get_data_response") @mock.patch("superset.charts.data.api.ChartDataCommand.validate") @mock.patch(