You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "rusackas (via GitHub)" <gi...@apache.org> on 2026/10/12 13:34:53 UTC

[I] Pivot table export/report path has no result-aggregation support (Median/Count/Sample Variance diverge from chart) [superset]

rusackas opened a new issue, #45215:
URL: https://github.com/apache/superset/issues/45215

   ### Bug description
   
   The Pivot Table's "result aggregation" control (`aggregateFunction`, e.g. Median/Count/Sample Variance — a second aggregation pass over a metric's own grouped results) is only implemented in the live browser chart. `superset/charts/client_processing.py`'s `pivot_table_v2()` post-processor — the path used for scheduled reports, alerts, and CSV/XLSX exports — has no result-aggregation support at all: any value it doesn't recognize in `pivot_v2_aggfunc_map` (which is every result-aggregation value except the handful that happen to share a name with the old per-table aggfunc) silently falls back to `"Sum"`, regardless of what's actually configured.
   
   This was previously tracked under #44625's "follow-up scope," but #44625 was closed for a narrower, already-fixed bug (non-additive-metric re-aggregation under `percent_mode`/`rollup_levels`) — this specific gap was never actually tracked on its own and has no open issue.
   
   ### Repro (reported during review of #44657)
   
   With a result aggregation configured on a pivot table:
   - `Median`: chart shows `2.5` in the corner cell, export shows `4.0`.
   - `Count`: chart shows the real per-leaf counts (e.g. `1`/`2`/`3`/`10`), export shows `1` for every leaf.
   - `Sample Variance`: chart shows `0.5`/`24.5` for its totals, export shows `0`.
   
   All three come from the same underlying cause: the export path's `aggregate_function` fallback always resolves to `"Sum"` for any result-aggregation value, since `pivot_v2_aggfunc_map` only covers the old per-table aggregation function set, not the restored result-aggregation control's values.
   
   ### How to fix
   
   `pivot_v2_aggfunc_map` (or the `aggregate_function` resolution in `pivot_table_v2()`, `superset/charts/client_processing.py`) needs real entries for the result-aggregation values (Median, Count, Count Unique Values, Sample Variance, Sample Standard Deviation, Minimum, Maximum, First, Last, etc. — see `RESULT_AGGREGATIONS` in `superset-frontend/.../plugin-chart-pivot-table/src/plugin/resultAggregation.ts` for the full set and their frontend semantics) so the export path's pandas-side aggregation matches what the live chart computes.
   


-- 
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] Pivot table export/report path has no result-aggregation support (Median/Count/Sample Variance diverge from chart) [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #45215: Pivot table export/report path has no result-aggregation support (Median/Count/Sample Variance diverge from chart)
URL: https://github.com/apache/superset/issues/45215


-- 
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] Pivot table export/report path has no result-aggregation support (Median/Count/Sample Variance diverge from chart) [superset]

Posted by "7AbdUrRehman7 (via GitHub)" <gi...@apache.org>.
7AbdUrRehman7 commented on issue #45215:
URL: https://github.com/apache/superset/issues/45215#issuecomment-6271760135

   Hi @rusackas, my team and I are UTSC students and would like to work on this. Is it still free to take?


-- 
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] Pivot table export/report path has no result-aggregation support (Median/Count/Sample Variance diverge from chart) [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #45215:
URL: https://github.com/apache/superset/issues/45215#issuecomment-6355482617

   Looks like #44657 covered this when it merged. The export path in `pivot_table_v2()` now has real reducers for Median, Count and Sample Variance instead of falling back to Sum. Closing, but ping me to reopen if you still see a divergence.


-- 
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