SEPURI-SAI-KRISHNA opened a new issue, #45438:
URL: https://github.com/apache/superset/issues/45438

   ### Bug description
   
   A Table chart's column config has a small-number format next to the normal 
one.
   The plugin applies it per cell: `formatColumnValue`
   (`plugin-chart-table/src/utils/formatValue.ts`) sends a numeric value with
   `Math.abs(value) < 1` through `getSmallNumberFormatter(formatter,
   config.d3SmallNumberFormat, config.currencyFormat)` and everything else 
through
   the column's normal formatter.
   
   The report-side reproduction of that formatting never reads the key.
   `superset/charts/client_processing.py` `table()` reads `currencyFormat` and
   `d3NumberFormat` out of the column config and nothing else, and
   `d3SmallNumberFormat` does not appear anywhere under `superset/`. So the 
table
   embedded in a scheduled report shows the small values with the column's 
normal
   format while Explore shows them with the small-number one.
   
   This is the next formatter branch after `d3TimeFormat`, reported in #45409 
and
   fixed in #45410. Both are gaps in the formatting #42820 brought to the report
   path.
   
   ### Reproduction
   
   1. Build a Table chart with a numeric metric that has values on both sides 
of 1,
      for example `0.0523` and `12.5`.
   2. In the column config set the number format to `,.2f` and the small-number
      format to `.1%`.
   3. Look at the chart: `5.2%` and `12.50`.
   4. Schedule a report with that chart and look at the table in the email.
   
   Running the real `table()` from `master` on that config:
   
   ```
   server (report) -> ['0.05', '12.50']
   browser         -> ['5.2%', '12.50']
   ```
   
   The browser values were produced with the repo's own d3-format 3.1.0.
   
   ### Expected behaviour
   
   `table()` picks the formatter per value the way the plugin does, so a cell 
below
   one in absolute value uses `d3SmallNumberFormat`, paired with the column
   config's currency when one is set, exactly what `getSmallNumberFormatter`
   builds.
   
   ### Scope
   
   `table()` formats only when `apply_number_format` is set, which
   `apply_client_processing` does for `result_format == JSON`, the
   `post_processed` payload a report requests for the table embedded in the 
email.
   CSV and XLSX attachments keep raw numeric cells by design, so they are
   unaffected. Same scope as #45409.
   
   ### Superset version
   
   master / latest-dev
   
   ### Python version
   
   3.11
   
   ### Node version
   
   Not applicable
   
   ### Browser
   
   Not applicable
   
   ### Additional context
   
   Verified against `master` at `dfd13baab0` by running the real `table()` from
   that commit, and the expected browser output by running the specifiers 
through
   the repo's own d3-format build.
   
   ### Checklist
   
   - [x] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [x] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [x] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.
   


-- 
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]

Reply via email to