mikebridge opened a new pull request, #45527:
URL: https://github.com/apache/superset/pull/45527
### SUMMARY
**What users saw:** XLSX reports of semantic-view Table charts could lose
the first dimension's header. A workbook containing `Category` and `Total
amount` came back with a blank first header, even though the values were
present. A selected numeric dimension containing `0, 1, ...` could also be
mistaken for a default row index and dropped.
**Why:** XLSX post-processing inferred a serialized index using an
incomplete set of selected column names. It omitted Table groupby/raw-column
selections and did not recognize datasource display labels already applied by
the export producer.
**What this changes:** Recognize those selections, percent-metric names, and
display labels before inferring an index. The existing handling of genuine
indexes, Pivot exports, and CSV serialization stays unchanged. This is a shared
export-path fix, not a semantic-provider-specific workaround.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Workbook example (no UI change):
```text
Before: [blank], Total amount
Books, 15
After: Category, Total amount
Books, 15
```
### TESTING INSTRUCTIONS
1. Create a Table chart with a dimension and metric whose display labels
differ from their identifiers.
2. Export it through the post-processed XLSX/report path. Confirm that both
headers and values survive.
3. Retry with a numeric first dimension containing `0, 1`; confirm it is
retained as data.
4. Confirm SQL-dataset Table and multi-row Pivot exports retain their
headers and values in XLSX and CSV.
Automated:
```sh
python -m pytest tests/unit_tests/charts/ -q
pre-commit run --files superset/charts/client_processing.py
tests/unit_tests/charts/test_client_processing.py
```
Added regression cases were observed failing before the fix. SQL-dataset
compatibility cases passed on both the baseline and the fixed code. The
complete charts suite plus a local report-content reproduction passed with
**500 passed, 2 xfailed**; changed-file hooks, including MyPy, passed. The
report reproduction exercised creator/fixed-user exports through the real
mapper/API with a stub provider and mocked outbound transport; no real
notifications were sent.
This restores the expected export contract without changing user steps or
configuration, so no new documentation or upgrade instructions are needed.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in
[SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
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]