You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "rusackas (via GitHub)" <gi...@apache.org> on 2026/06/02 01:57:32 UTC

[PR] chore(excel): strip document metadata from Excel exports [superset]

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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] chore(excel): strip document metadata from Excel exports [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas merged PR #40661:
URL: https://github.com/apache/superset/pull/40661


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] chore(excel): strip document metadata from Excel exports [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #40661:
URL: https://github.com/apache/superset/pull/40661#issuecomment-4598073889

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/40661?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `75.00000%` with `1 line` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 55.34%. Comparing base ([`41da35e`](https://app.codecov.io/gh/apache/superset/commit/41da35e9db016106f183764b6687a02580833da3?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`1f6361e`](https://app.codecov.io/gh/apache/superset/commit/1f6361e27875c3ee540adbff5df5355e4d20d5c5?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/40661?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [superset/utils/excel.py](https://app.codecov.io/gh/apache/superset/pull/40661?src=pr&el=tree&filepath=superset%2Futils%2Fexcel.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvdXRpbHMvZXhjZWwucHk=) | 75.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/40661?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   > :exclamation:  There is a different number of reports uploaded between BASE (41da35e) and HEAD (1f6361e). Click for more details.
   > 
   > <details><summary>HEAD has 65 uploads less than BASE</summary>
   >
   >| Flag | BASE (41da35e) | HEAD (1f6361e) |
   >|------|------|------|
   >|python|57|2|
   >|hive|6|1|
   >|presto|6|1|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #40661      +/-   ##
   ==========================================
   - Coverage   63.94%   55.34%   -8.61%     
   ==========================================
     Files        2658     2658              
     Lines      143011   143015       +4     
     Branches    32866    32866              
   ==========================================
   - Hits        91454    79154   -12300     
   - Misses      49994    63173   +13179     
   + Partials     1563      688     -875     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/40661/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [hive](https://app.codecov.io/gh/apache/superset/pull/40661/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `39.76% <75.00%> (+<0.01%)` | :arrow_up: |
   | [mysql](https://app.codecov.io/gh/apache/superset/pull/40661/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [postgres](https://app.codecov.io/gh/apache/superset/pull/40661/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [presto](https://app.codecov.io/gh/apache/superset/pull/40661/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `41.36% <75.00%> (+<0.01%)` | :arrow_up: |
   | [python](https://app.codecov.io/gh/apache/superset/pull/40661/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `41.43% <75.00%> (-18.54%)` | :arrow_down: |
   | [sqlite](https://app.codecov.io/gh/apache/superset/pull/40661/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [unit](https://app.codecov.io/gh/apache/superset/pull/40661/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/superset/pull/40661?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] chore(excel): strip document metadata from Excel exports [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #40661:
URL: https://github.com/apache/superset/pull/40661#issuecomment-4598052242

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org