Skip to content

Export to pivoted Excel inconsistent formatting #38555

@carlosaran667

Description

@carlosaran667

Bug description

I tried the new "Export to Pivoted Excel" feature for pivot tables and found an inconsistency in number formatting when using a custom D3_FORMAT.

I am using standard Spanish formatting in config.py:
D3_FORMAT: D3Format = {
"decimal": ",",
"thousands": ".",
"grouping": [3],
"currency": ["", "€"]
}

Steps to reproduce

  1. Swap decimal and thousands separators in D3_FORMAT in the configuration file.
  2. Restart Superset.
  3. Create a "pivot table" graph.
  4. Select a metric with decimal values.
  5. Click on Download -> Export to Pivoted Excel

Expected behavior

Exported decimal values should respect the decimal separator defined in D3_FORMAT.

Actual behavior

When exporting with Export to Pivoted Excel, plain decimal numbers do not respect the decimal separator configured in D3_FORMAT.

Percentages and currency values are exported correctly (although percentage values with decimals seem to have a separate issue, which I will report independently).

In my case, since I switched from the default American-style formatting to Spanish formatting, this causes wrong values to be exported to Excel.

Additional context

I tried modifying "EXCEL_EXPORT: dict[str, Any] = {}" in config.py, but it looks like this export path is using a front-end hard-coded configuration instead of EXCEL_EXPORT.

Screenshots/recordings

Superset UI:
Image

Excel:
Image

Superset version

6.0.0

Python version

3.10

Node version

I don't know

Browser

Firefox

Additional context

Tested on both Firefox and Microsoft Edge.

FEATURE_FLAGS: dict[str, bool] = {
"DASHBOARD_RBAC": True,
"ENABLE_TEMPLATE_PROCESSING": True,
"CACHE_QUERY_BY_USER": True,
"CACHE_IMPERSONATION": True,
}

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions