SEPURI-SAI-KRISHNA commented on PR #45439:
URL: https://github.com/apache/superset/pull/45439#issuecomment-6284319789
One thing I found while checking this against the AG Grid table, which
shares this post-processor in #45456, and which changed the code here.
`ColumnConfigControl` offers `d3SmallNumberFormat` for both plugins, but the
AG Grid table never applies it. `useColDefs` gives every column
`valueFormatter: p => valueFormatter(p, col)`, and that function formats with
`col.formatter` alone:
```ts
if (col.formatter instanceof CurrencyFormatter) {
return (
col.formatter(value, data, col.currencyCodeColumn) || String(value)
);
}
return col.formatter?.(value) || String(value);
```
`NumericCellRenderer` then renders `valueFormatted`. The plugin's own
`formatColumnValue`, the one that calls `getSmallNumberFormatter`, is only used
for drill-to-detail filter labels. So the format is configurable on an AG Grid
table and has no effect on its cells.
Rather than have a report apply a format the chart ignores, `table()` skips
the small-number format for `ag-grid-table`. The number and time branches do
match the Table plugin line for line, so nothing else needed scoping.
`test_ag_grid_table_ignores_a_small_number_format` runs the same column config
through both viz types and asserts `["0.50", "12.50"]` against `["50.0%",
"12.50"]`.
The gap in the AG Grid plugin itself looks worth closing separately, and I
am happy to open an issue for it if you agree it is one.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]