You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "LouisP-SuperiorWellness (via GitHub)" <gi...@apache.org> on 2025/08/18 08:23:19 UTC
[I] Exporting Pivot Tables (Pivoted CSV) Flattens Columns [superset]
LouisP-SuperiorWellness opened a new issue, #34731:
URL: https://github.com/apache/superset/issues/34731
### Bug description
When exporting a pivot table from Superset to a pivoted csv, it flattens the columns:
<img width="518" height="68" alt="Image" src="https://github.com/user-attachments/assets/52bacde1-94cf-4f17-b16f-96d79310d20a" />
<img width="563" height="25" alt="Image" src="https://github.com/user-attachments/assets/6686a6b5-e137-482d-a21f-cef84b46db6a" />
As you can see, the Name, Colour and Locations columns get flattened into a single column.
I did find an existing bug report: https://github.com/apache/superset/issues/30658?
And attempted to follow the fixes, but to no success, according to some cursory research it seems the exporting has been moved from the python code to JS at some point?
Any advice on how I could fix this issue would be greatly appreciated.
Thanks in advance,
Louis
### Screenshots/recordings
_No response_
### Superset version
master / latest-dev
### Python version
3.9
### Node version
16
### Browser
Chrome
### Additional context
_No response_
### Checklist
- [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
--
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.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: [I] Exporting Pivot Tables (Pivoted CSV) Flattens Columns [superset]
Posted by "msyavuz (via GitHub)" <gi...@apache.org>.
msyavuz commented on issue #34731:
URL: https://github.com/apache/superset/issues/34731#issuecomment-3195839250
Feel free to keep this open until it’s fixed. If you have an idea for how to tackle it, a PR would be super welcome. Happy to help review and discuss approaches!
--
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: [I] Exporting Pivot Tables (Pivoted CSV) Flattens Columns [superset]
Posted by "LouisP-SuperiorWellness (via GitHub)" <gi...@apache.org>.
LouisP-SuperiorWellness commented on issue #34731:
URL: https://github.com/apache/superset/issues/34731#issuecomment-3195718501
Hi @msyavuz cheers for the response, yeah i've just seen this! I'm pulling down a fresh copy of Superset now to have a look! Cheers for your response. I'll close down this issue shortly :)
--
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: [I] Exporting Pivot Tables (Pivoted CSV) Flattens Columns [superset]
Posted by "LouisP-SuperiorWellness (via GitHub)" <gi...@apache.org>.
LouisP-SuperiorWellness closed issue #34731: Exporting Pivot Tables (Pivoted CSV) Flattens Columns
URL: https://github.com/apache/superset/issues/34731
--
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: [I] Exporting Pivot Tables (Pivoted CSV) Flattens Columns [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #34731:
URL: https://github.com/apache/superset/issues/34731#issuecomment-3195647688
<!-- Greeting -->
Hi @LouisP-SuperiorWellness! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the superset team.
<!-- Answer -->
This is a known issue: when exporting a pivot table to CSV, multi-level columns (like Name, Colour, Location) are flattened into a single column in the output. The export logic for pivoted CSVs has moved to the frontend JavaScript code, specifically in components like `ExportToCSVDropdown` and the pivot table plugin files, which serialize the table for export by concatenating column names rather than preserving the hierarchy [[source](https://github.com/apache/superset/issues/32369)].
There isn't a straightforward fix or configuration to change this behavior in the current release. Maintainers have acknowledged the limitation and indicated that improvements are open for community contributions but not prioritized by core committers [[source](https://github.com/apache/superset/issues/32369)].
As a workaround, Superset recently added the ability to export pivot tables as pivoted Excel files, which preserves the multi-level column structure using the SheetJS library. You can use the "Export to Pivoted Excel" option from the chart or dashboard menu to get the correct structure in Excel format [[source](https://github.com/apache/superset/pull/33569)]. If you specifically need CSV, you might need to manually convert the Excel file to CSV after export.
If you want to explore or contribute a fix, the relevant logic for CSV export is in the frontend files, especially around the pivot table plugin and export dropdown components. Any changes to how multi-level columns are handled would need to be made there.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
---
<sup>How did I do? [Good](https://app.dosu.dev/response-feedback/79d62d57-f327-4352-8ec7-3e886f5293a3?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/79d62d57-f327-4352-8ec7-3e886f5293a3?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/79d62d57-f327-4352-8ec7-3e886f5293a3?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/79d62d57-f327-4352-8ec7-3e886f5293a3?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/79d62d57-f327-4352-8ec7-3e886f5293a3?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/79d62d57-f327-4352-8ec7-3e886f5293a3?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/79d62d57-f327-4352-8ec7-3e886f5293a3?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=githu
b) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/34731)
--
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: [I] Exporting Pivot Tables (Pivoted CSV) Flattens Columns [superset]
Posted by "msyavuz (via GitHub)" <gi...@apache.org>.
msyavuz commented on issue #34731:
URL: https://github.com/apache/superset/issues/34731#issuecomment-3195670002
There was a new [feature for pivoted excel](https://github.com/apache/superset/pull/33569) recently, we can probably take a similar approach with csv as well to reduce roundtrips with server and prevent issues like this.
--
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