Repository navigation
feat(chart-data): export the Spreadsheet chart to Excel with its edits - #45279
Draft
AliIbnBotir wants to merge 4 commits into
Draft
AliIbnBotir wants to merge 4 commits into
AliIbnBotir wants to merge 4 commits into
Conversation
flatten reset only the first level of a MultiIndex, so a pivot with several index columns lost the others when the result was serialized. A single-level index is reset as before. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Charts can tell whether they render in Explore, on a dashboard or embedded (standalone Explore, also used for report screenshots), e.g. to allow editing only in Explore. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A Table-category chart that shows the query result as an Excel-like sheet using Univer's open source packages. In Explore it is a full editor whose edits (formatting, formulas, renamed headers, extra sheets) are saved in the chart's form data; on dashboards it is read-only with fresh data. Query modes: aggregate, raw records and pivot (pivot and flatten post-processing on the backend). Rows can be grouped by dimensions with subtotals and collapsible groups. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
For the univer_sheet viz type, the XLSX chart-data export writes the sheet as shown in the chart: renamed headers, formulas with cached values, styles, merges, column widths, frozen panes, pivot headers and row groups as Excel outline groups. Other charts keep the plain export. openpyxl, already installed through pandas[excel], becomes a direct dependency for its formula translator. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #45279 +/- ##
===========================================
- Coverage 83.29% 64.89% -18.41%
===========================================
Files 3039 3040 +1
Lines 198375 198960 +585
Branches 46213 46338 +125
===========================================
- Hits 165235 129110 -36125
- Misses 29916 66949 +37033
+ Partials 3224 2901 -323
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
Part of SIP #45265.
"Export to Excel" on a Spreadsheet chart writes the sheet as the user sees it instead of the raw query result:
How it works:
QueryContextProcessor.get_data, an XLSX request whose form data hasviz_type == "univer_sheet"goes to the newsuperset/utils/univer_excel.pyinstead ofexcel.df_to_excel. Every other chart takes the existing path unchanged.univer_excel.pyrebuilds the same sheet the browser shows (data area, pivot headers, groups, saved edits fromuniver_workbook) and writes it with XlsxWriter, which is already a dependency.openpyxl's formula translator.openpyxlwas already installed throughpandas[excel]and is now declared directly inpyproject.toml(>=3.1.5, <4).requirements/*.txtare updated accordingly, no new package is installed.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before: the .xlsx contained the raw query result with the original column names and no formatting, formulas or groups.
TESTING INSTRUCTIONS
Automated:
pytest tests/unit_tests/utils/univer_excel_test.py tests/unit_tests/common/test_query_context_processor.pyManual (needs the chart PR):
ADDITIONAL INFORMATION