bito-code-review[bot] commented on PR #44664:
URL: https://github.com/apache/superset/pull/44664#issuecomment-5838674148
<!-- Bito Reply -->
The flagged issue is correct. In `superset/utils/excel_conditional.py`, the
`polish_explore_xlsx` function explicitly skips display formatting (which
includes number formatting) when `viz_type` is `pivot_table_v2` and
`showValuesAs` is set to a percentage mode. This is intended to prevent
conflicts, but it results in fractional values being displayed with General
formatting instead of percentage formatting.
To resolve this, you can modify `polish_explore_xlsx` to apply percentage
formatting even when `skip_display` is true, or ensure that the percentage
format is applied separately. Given the current implementation, you could
update the logic to allow percentage formatting while still skipping other
display styles if necessary.
Would you like me to fetch all other comments on this PR to validate and
implement fixes for them as well?
**superset/utils/excel_conditional.py**
```
skip_display = viz_type == "pivot_table_v2" and
form_data.get("showValuesAs") in (
SHOW_VALUES_AS_PERCENT_MODES
)
if not skip_display:
headers = [str(column) for column in df.columns]
if viz_type == "table":
styles = styles_from_table_form_data(headers, form_data)
else:
styles = styles_from_pivot_form_data(headers, form_data)
workbook_bytes = apply_column_display(
workbook_bytes, styles, header_rows=header_rows
)
```
--
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]