bazhil opened a new pull request, #44719: URL: https://github.com/apache/superset/pull/44719
### SUMMARY Table Explore already honors per-column **Text align** (`column_config.horizontalAlign`) in the chart. XLSX download wrote number/date formats through `polish_explore_xlsx`, but alignment was dropped when `column_config` keys did not match the sheet headers (after `verbose_map` rename) or when styles were matched only by reading header cells from an xlsxwriter workbook. This change resolves `column_config` keys against raw and verbose names (same idea as native Excel CF on this stack) and stamps `Alignment` onto data cells **by column index** for Table exports, so left/center/right from Customize show up in Excel for both numeric and string columns. No UI, API, or migration changes. Pivot display path is unchanged (no Table-style `horizontalAlign` there). ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF **Before** (`feature/excel-conditional-formatting-export` without this patch): Explore Table, Customize → Text align **center** on `qty`, `sample_flag`, `salesperson`. Chart cells are centered. Downloaded XLSX keeps default left/General alignment on those columns. <img width="1668" height="899" alt="Снимок экрана от 2026-09-27 01-08-40" src="https://github.com/user-attachments/assets/f5580b74-2b6d-4b19-8214-ebdce0bf84d6" /> <img width="1668" height="899" alt="Снимок экрана от 2026-09-27 01-08-26" src="https://github.com/user-attachments/assets/4925b65d-ed09-4741-ac92-86b63b91cd22" /> <img width="1668" height="899" alt="Снимок экрана от 2026-09-27 01-07-37" src="https://github.com/user-attachments/assets/5c5718cb-4942-49c7-987b-941b103b0269" /> **After** (this branch): the same columns in the XLSX are centered (LibreOffice / Excel cell alignment). Chart unchanged. <img width="1668" height="899" alt="Снимок экрана от 2026-09-27 01-38-26" src="https://github.com/user-attachments/assets/e7d351a7-c679-48aa-8c98-e71a0301dc79" /> <img width="1668" height="899" alt="Снимок экрана от 2026-09-27 01-38-19" src="https://github.com/user-attachments/assets/db2b150b-36b6-4162-a7fe-4924fb7f8427" /> <img width="1668" height="899" alt="Снимок экрана от 2026-09-27 01-38-13" src="https://github.com/user-attachments/assets/da180ef7-c6da-4f0e-b39a-e82ca01e2c1b" /> ### TESTING INSTRUCTIONS 1. Check out `feature/excel-table-text-align` (includes Excel polish from #44664). 2. Open Explore → **Table** (raw records is enough). 3. Customize columns: set **Text align** to center (or right) on a numeric column and a string column. Confirm the on-screen table updates. 4. Download → **Excel**. 5. Open the file and check cell alignment on those columns (Format cells → Alignment, or visual check on a wide column). 6. Optional: dataset with a verbose name different from `column_name` — config still keyed by the physical name; the sheet header is the label. Alignment should still apply. 7. Unit tests: ```bash pytest tests/unit_tests/utils/test_excel_display.py \ tests/unit_tests/utils/test_excel_conditional.py -q ``` ### ADDITIONAL INFORMATION - [x] Has associated issue: follow-up to [#44664](https://github.com/apache/superset/pull/44664) (Explore Table XLSX display). No new GitHub issue required unless opened separately. - [ ] 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]
