diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/operators/pivotOperator.ts b/superset-frontend/packages/superset-ui-chart-controls/src/operators/pivotOperator.ts index bdb2bdf273ed4..564495fcbcffd 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/operators/pivotOperator.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/src/operators/pivotOperator.ts @@ -44,7 +44,7 @@ export const pivotOperator: PostProcessingFactory = ( aggregates: Object.fromEntries( metricLabels.map(metric => [metric, { operator: 'mean' }]), ), - drop_missing_columns: !!formData?.drop_missing_columns, + drop_missing_columns: !formData?.show_empty_columns, }, }; } diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/operators/timeComparePivotOperator.ts b/superset-frontend/packages/superset-ui-chart-controls/src/operators/timeComparePivotOperator.ts index 20d4b6f323fbc..a4c0f5eea6c6e 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/operators/timeComparePivotOperator.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/src/operators/timeComparePivotOperator.ts @@ -46,7 +46,7 @@ export const timeComparePivotOperator: PostProcessingFactory = { description: t('Whether to truncate metrics'), }; -const drop_missing_columns: SharedControlConfig<'CheckboxControl'> = { +const show_empty_columns: SharedControlConfig<'CheckboxControl'> = { type: 'CheckboxControl', - label: t('Drop Missing Columns'), - default: false, - description: t('Drop a column if all values are null'), + label: t('Show empty columns'), + default: true, + description: t('Show empty columns'), }; const x_axis: SharedControlConfig<'SelectControl', ColumnMeta> = { @@ -594,7 +594,7 @@ const sharedControls = { legacy_order_by: enableExploreDnd ? dnd_sort_by : sort_by, truncate_metric, x_axis: enableExploreDnd ? dnd_x_axis : x_axis, - drop_missing_columns, + show_empty_columns, }; export { sharedControls, dndEntity, dndColumnsControl }; diff --git a/superset-frontend/packages/superset-ui-chart-controls/test/operators/pivotOperator.test.ts b/superset-frontend/packages/superset-ui-chart-controls/test/operators/pivotOperator.test.ts index edde99189a5d3..41c294b405a88 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/test/operators/pivotOperator.test.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/test/operators/pivotOperator.test.ts @@ -28,6 +28,7 @@ const formData: SqlaFormData = { granularity: 'month', datasource: 'foo', viz_type: 'table', + show_empty_columns: true, }; const queryObject: QueryObject = { metrics: [ diff --git a/superset-frontend/packages/superset-ui-chart-controls/test/operators/timeComparePivotOperator.test.ts b/superset-frontend/packages/superset-ui-chart-controls/test/operators/timeComparePivotOperator.test.ts index 27ddef32dbf35..304756dee7637 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/test/operators/timeComparePivotOperator.test.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/test/operators/timeComparePivotOperator.test.ts @@ -31,6 +31,7 @@ const formData: SqlaFormData = { granularity: 'month', datasource: 'foo', viz_type: 'table', + show_empty_columns: true, }; const queryObject: QueryObject = { metrics: [ diff --git a/superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/buildQuery.test.ts b/superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/buildQuery.test.ts index 4b39639c2d977..8236ca23cc081 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/buildQuery.test.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/buildQuery.test.ts @@ -48,6 +48,7 @@ const formDataMixedChart = { order_desc: true, emit_filter: true, truncate_metric: true, + show_empty_columns: true, // -- query b groupby_b: [], metrics_b: ['count'], @@ -64,6 +65,7 @@ const formDataMixedChart = { order_desc_b: false, emit_filter_b: undefined, truncate_metric_b: true, + show_empty_columns_b: true, // chart configs show_value: false, show_valueB: undefined,