Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export as pivoted .csv merges selected 'Rows' fields #32369

Open
3 tasks done
Jockxtar opened this issue Feb 25, 2025 · 1 comment
Open
3 tasks done

Export as pivoted .csv merges selected 'Rows' fields #32369

Jockxtar opened this issue Feb 25, 2025 · 1 comment
Labels
data:csv Related to import/export of CSVs viz:charts:pivot Related to the Pivot Table charts

Comments

@Jockxtar
Copy link

Bug description

I'm trying to make the "Export to pivoted .CSV" option work for a (relatively) convoluted pivot table and I found some issues. I will create a bug report for each of them.

Description

If the pivot table has multiple fields selected as 'Rows', the resulting csv file merges all of them into one column, instead of separating them like in the table shown in the browser (check screenshots).

Steps to reproduce:

  1. Create a "pivot table" graph.
  2. Select multiple 'Rows' under the data section.
  3. Select one or multiple 'Metrics'.
  4. Click on 'Download' -> 'Export to pivoted .CSV'

Additional information

If you select 'ROWS' in 'APPLY METRICS ON' instead of 'COLUMNS', it will then merge the name of the metrics and the rows fields.

Screenshots/recordings

  • Browser
    Image

  • CSV
    Image

Superset version

4.1.1

Python version

3.10

Node version

I don't know

Browser

Firefox

Additional context

Source code:

I'm using version 4.1.1, but I tried updating 'post_processing.py' to match what's in the master branch's 'client_processing.py' since I needed PR #29898 (which doesn't seem to affect this issue).

Feature flags:

"DASHBOARD_RBAC": True,
"ENABLE_TEMPLATE_PROCESSING": True,
"CACHE_QUERY_BY_USER": True,
"CACHE_IMPERSONATION": True

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • 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.
Copy link

dosubot bot commented Feb 25, 2025

The issue you're experiencing with the "Export to pivoted .CSV" feature, where multiple 'Rows' fields are merged into one column in the resulting CSV file, seems to be a known problem. Unfortunately, I couldn't find specific details in the Superset codebase about how this feature handles multiple 'Rows' fields during export. However, there is a comment in the codebase indicating that any changes to the logic in the PivotTableChart.tsx file should be reflected in the corresponding Python function in post_processing.py [1].

Since you've already tried updating post_processing.py to match the master branch's client_processing.py and noted that PR #29898 doesn't seem to affect this issue, it might be worth investigating further into the logic within these files to see if there are any discrepancies or areas that could be adjusted to handle multiple 'Rows' fields correctly.

If you haven't already, you might want to check if there are any recent updates or discussions in the Superset community that address this specific issue, as it could be a bug that others have encountered as well.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot dosubot bot added data:csv Related to import/export of CSVs viz:charts:pivot Related to the Pivot Table charts labels Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:csv Related to import/export of CSVs viz:charts:pivot Related to the Pivot Table charts
Projects
None yet
Development

No branches or pull requests

1 participant