Pivot table reports/exports pick an arbitrary metric for a mixed-metric total instead of blanking it
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- backend, data-visualization
Research direction
Start in superset/charts/client_processing.py at _collapsed_metric and read how the scheduled-report, alert, CSV, and Excel export path handles mixed-metric totals. Align those totals with the blank behavior described for the live pivot_table_v2 view, update the stale docstring, and verify that percent-mode exports no longer calculate a value for a mixed-metric slot.
Written by the indexing model from the issue text.
Description
Bug description
superset/charts/client_processing.py's _collapsed_metric (used by the scheduled-report/alert/CSV/Excel export path for pivot_table_v2) resolves a mixed-metric total (a "Metric"-collapsed row/column/grand total on a pivot with 2+ metrics on one axis) to an arbitrary metric -- the last one in the chart's configured metric order -- and computes a real percentage for it in showValuesAs percent modes.
This now disagrees with the live browser view: apache/superset#44657 changed the browser to render that same cell blank instead, since there's no single meaningful value for "MAX(sales) combined with MEDIAN(msrp)" (or whichever two metrics happen to share the collapsed slot). A scheduled report or export can therefore show a specific, plausible-looking percentage for a cell the interactive chart deliberately leaves blank.
_collapsed_metric's own docstring is now stale -- it explicitly says it mirrors "the last metric pushed into the shared slot (see the metricAxis handling in react-pivottable/utilities.ts)", which was the browser's old behavior before #44657.
How to reproduce
- A pivot_table_v2 chart with 2+ metrics laid out on columns (
metricsLayout: Columns),showValuesAsset to a percent mode, row and/or column totals enabled. - Compare the grand-total/Total-axis cell opposite the Metric pseudo-dimension between the live Explore view (blank, per #44657) and a scheduled report, alert, or CSV/Excel export of the same chart (a computed percentage).
Scope note
This is separate from #44625 (which was about non-additive metrics re-aggregating already-aggregated cells in Actual Values mode, fixed by #44631) -- this is specifically about the mixed-metric "last metric wins" fallback in _collapsed_metric, only reachable with 2+ metrics sharing a collapsed axis slot.
- Dominant language
- Python
- Stars
- 74.8k
- Forks
- 18.4k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 667
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/superset
-
🦾 ai-candidate
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
dashboard:native-filters 🦾 ai-candidate
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
apache/superset#44530 · 1 comment ·
Maintainers usually reply within 1 day
-
Six restore-version command unit tests fail on master, reddening unit-tests-required on every PROpen🦾 ai-candidate
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
apache/superset#44436 · 2 comments ·
Maintainers usually reply within 1 day
-
#bug:cosmetic dashboard:native-filters 🦾 ai-candidate
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
apache/superset#44350 · 1 comment ·
Maintainers usually reply within 1 day
-
viz:charts:timeseries
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
apache/superset#43068 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
qgis/QGIS-Plugins-Website#459 ·
-
bug severity:medium
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
bot-found bug priority: P3
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
madenvel/KalinkaPlayer#179 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ls1intum/edutelligence#1098 ·
Maintainers usually reply within 1 day