You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 there are several metrics with the same label, the values of the first metric are repeated on the others.
Steps to reproduce:
Create a pivot table.
Add at least 2 metrics with the same label.
Click on 'Download' -> 'Export to pivoted .CSV'
Proposed solution
Instead of filling the csv file based on the metrics' labels, I think it should use the metrics names since they are always unique.
Screenshots/recordings
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).
The issue you're experiencing with duplicated values in the pivoted CSV export when using repeated metric labels is related to how Superset handles metric labels during the export process. Superset ensures uniqueness in metric identification by validating that there are no duplicate labels before proceeding with the export. If duplicate labels are detected, it raises a QueryObjectValidationError to prevent the export [1].
Your proposed solution to use metric names instead of labels for filling the CSV file is a valid approach, as metric names are inherently unique. This change would prevent the duplication issue you're encountering.
To address this issue, you might consider modifying the export logic to use metric names instead of labels. This would involve ensuring that the export process references the unique metric identifiers rather than potentially duplicated labels.
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 there are several metrics with the same label, the values of the first metric are repeated on the others.
Steps to reproduce:
Proposed solution
Instead of filling the csv file based on the metrics' labels, I think it should use the metrics names since they are always unique.
Screenshots/recordings
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:
Checklist
The text was updated successfully, but these errors were encountered: