rusackas opened a new pull request, #40661: URL: https://github.com/apache/superset/pull/40661
### SUMMARY When generating `.xlsx` exports via `superset/utils/excel.py` (`df_to_excel`), the underlying `xlsxwriter` engine embeds workbook document properties into `docProps/core.xml` — notably `created`/`modified` timestamps set to the actual generation time of the file. This change resets the workbook document properties before the file is written so exported workbooks carry a clean, neutral set of metadata rather than environment-specific details. Specifically, `df_to_excel` now calls `workbook.set_properties(...)` to: - Clear the authoring/descriptive fields: `title`, `subject`, `author`, `manager`, `company`, `category`, `keywords`, `comments`, `status`. - Pin `created`/`modified` to a fixed, neutral timestamp (`2000-01-01`) instead of the real generation time. The actual sheet data is untouched — only the workbook's core document properties are normalized. This is the single shared export path used by both the chart/dashboard data export (`query_context_processor`) and the legacy CSV/Excel view export (`views/core.py`). ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF Not applicable (no UI change). Before — `docProps/core.xml` contained live generation timestamps: ```xml <dcterms:created>2026-06-02T01:55:41Z</dcterms:created> <dcterms:modified>2026-06-02T01:55:41Z</dcterms:modified> ``` After — neutral, fixed values: ```xml <dcterms:created>2000-01-01T00:00:00Z</dcterms:created> <dcterms:modified>2000-01-01T00:00:00Z</dcterms:modified> ``` ### TESTING INSTRUCTIONS - Run the unit test: `pytest tests/unit_tests/utils/excel_tests.py` - A new test `test_document_properties_are_neutral` generates an xlsx via `df_to_excel`, loads the bytes back with `openpyxl`, and asserts the core properties are empty/neutral and timestamps are pinned. - Manually: export a chart/dashboard to Excel and inspect `docProps/core.xml` inside the `.xlsx` (it is a zip); confirm authoring fields are empty and timestamps are neutral. ### 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 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
