You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
column_config[<key>].customColumnName already exists and both table renderers honour it for every column, but the UI lets you set it only on time-comparison columns. Please expose Display column name in Customize columns for every column of the Table and AG Grid Table charts. Big Number with Time Comparison already does exactly this for its columns.
Superset 6.1.0, same on master.
Why
A dataset's verbose_name and saved metric names are shared by every chart, so they have to be generic. A table header is read in one place and often needs to say something else:
the same metric appears twice in one table, with different filters or time shifts, and needs two distinguishable headers;
a narrow table needs a short header where the dataset name is long, or the unit already sits in the chart title and would repeat in every column;
one dashboard's audience uses a different term, or a different language, than the dataset metadata. We keep the dataset layer in English and customer-facing text in another language, and this is where we hit the limit first.
Today the only way to rename a table header is to give up the saved metric. The label pencil is disabled on the Saved tab, and a label typed on the Simple tab is dropped on save because DndMetricSelect.handleChange flattens saved metrics back to the bare metric_name. Dimensions can be relabelled only on the Custom SQL tab. So every table with its own headers ends up made of ad-hoc metrics and ad-hoc columns, which also hits #38339 and #38340. Changing verbose_name is no alternative: it renames the column in every other chart.
Current behaviour
plugin-chart-table/src/TableChart.tsx and plugin-chart-ag-grid-table/src/utils/useColDefs.ts render config.customColumnName || originalLabel for any column; CSV export uses the same label. A chart imported with the key set works and keeps it on save.
ColumnConfigControl.tsx prepends the General tab (customColumnName, displayTypeIcon, visible) only when col.isTimeComparisonColumn; otherwise it uses the plugin's configFormLayout or the default one, which has no name field.
BigNumberPeriodOverPeriod/controlPanel.ts passes a configFormLayout with that General tab for all its columns. The two table control panels pass no layout.
Proposal
Pass a configFormLayout from the Table and AG Grid Table control panels that prepends a General tab with customColumnName to the default layout of each data type, the way Big Number with Time Comparison does. displayTypeIcon stays time-comparison only; visible is optional.
Saved metrics keep their metric_name in metrics, sorting and search keep using the result-set key, and the header comes from column_config. It is a per-chart override, like d3NumberFormat there already is. The change is confined to two control panels plus tests. I am willing to open a PR if maintainers agree with the direction.
Out of scope
The root limitation is wider: a saved metric cannot carry a per-chart label in any chart type, so legends, Big Number titles and Pivot Table headers have the same problem without a column_config hook. Fixing that means letting metrics carry a saved metric together with a label, a form-data change that deserves its own discussion. This request only uses the hook the table charts already have.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Summary
column_config[<key>].customColumnNamealready exists and both table renderers honour it for every column, but the UI lets you set it only on time-comparison columns. Please expose Display column name in Customize columns for every column of the Table and AG Grid Table charts. Big Number with Time Comparison already does exactly this for its columns.Superset 6.1.0, same on
master.Why
A dataset's
verbose_nameand saved metric names are shared by every chart, so they have to be generic. A table header is read in one place and often needs to say something else:Today the only way to rename a table header is to give up the saved metric. The label pencil is disabled on the Saved tab, and a label typed on the Simple tab is dropped on save because
DndMetricSelect.handleChangeflattens saved metrics back to the baremetric_name. Dimensions can be relabelled only on the Custom SQL tab. So every table with its own headers ends up made of ad-hoc metrics and ad-hoc columns, which also hits #38339 and #38340. Changingverbose_nameis no alternative: it renames the column in every other chart.Current behaviour
plugin-chart-table/src/TableChart.tsxandplugin-chart-ag-grid-table/src/utils/useColDefs.tsrenderconfig.customColumnName || originalLabelfor any column; CSV export uses the same label. A chart imported with the key set works and keeps it on save.ColumnConfigControl.tsxprepends the General tab (customColumnName,displayTypeIcon,visible) only whencol.isTimeComparisonColumn; otherwise it uses the plugin'sconfigFormLayoutor the default one, which has no name field.BigNumberPeriodOverPeriod/controlPanel.tspasses aconfigFormLayoutwith that General tab for all its columns. The two table control panels pass no layout.Proposal
Pass a
configFormLayoutfrom the Table and AG Grid Table control panels that prepends a General tab withcustomColumnNameto the default layout of each data type, the way Big Number with Time Comparison does.displayTypeIconstays time-comparison only;visibleis optional.Saved metrics keep their
metric_nameinmetrics, sorting and search keep using the result-set key, and the header comes fromcolumn_config. It is a per-chart override, liked3NumberFormatthere already is. The change is confined to two control panels plus tests. I am willing to open a PR if maintainers agree with the direction.Out of scope
The root limitation is wider: a saved metric cannot carry a per-chart label in any chart type, so legends, Big Number titles and Pivot Table headers have the same problem without a
column_confighook. Fixing that means lettingmetricscarry a saved metric together with a label, a form-data change that deserves its own discussion. This request only uses the hook the table charts already have.All reactions