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/08/04 21:49:13 UTC

[PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

rusackas opened a new pull request, #42761:
URL: https://github.com/apache/superset/pull/42761

   ### SUMMARY
   
   #41463 (SIP-216, merged via #41184) correctly moved Pivot Table totals/subtotals to DB-computed rollup queries, fixing non-additive metrics (ratios, `COUNT_DISTINCT`, `AVG`, etc.) that were previously wrong when re-aggregated client-side. As part of that change, the Pivot Table's old "Aggregation function" control was removed entirely, and its "Sum as Fraction of Total/Rows/Columns" options went with it.
   
   That was collateral damage, not something the SIP identified as broken: those fraction variants only ever wrapped `Sum`/`Count` (both additive), so they were mathematically correct even before #41184, and users are now asking for the display mode back (originally raised against #41463).
   
   This reintroduces it as a standalone **"Show values as"** control, rather than resurrecting the removed per-metric "Aggregation function" selector. The new architecture actually makes this cleaner than before: every cell already holds a DB-correct rollup value at every scope (its own cell, row total, column total, grand total), so showing a value as a fraction of one of those scopes is now a pure presentational transform at render time. It reuses `react-pivottable`'s existing `fractionOf` template — the same one the old "Sum as Fraction of ..." options used — wrapping the current passthrough `cellValue` aggregator instead of `sum()`/`count()`, and reusing the same row/column/grand-total lookup (`getAggregator`) the removed feature relied on. No new query, no touching `grouping_sets`, no per-metric control to reintroduce.
   
   Percentage display always uses a fixed percent format; a per-metric custom formatter (currency, decimals, etc.) doesn't apply to a ratio, so custom column formatters are skipped while a fraction mode is active (matching the old behavior, which also always used a fixed percent formatter regardless of the metric's own format).
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Pivot table of `birth_names` (rows = `state`, columns = `gender`, metric = `sum__num`, row/column totals on), cycling through the new control:
   
   **Actual values (default, unchanged behavior):**
   
   <img width="800" alt="Actual values, with row and column totals" src="https://github.com/user-attachments/assets/19b4df89-ae9d-48e3-b50f-151359467ced" />
   
   **% of row total** — every row (and the row-total column) sums to 100.0%:
   
   <img width="800" alt="Percent of row total" src="https://github.com/user-attachments/assets/5e10784f-7d91-4119-9bdf-5a1e7a8e1d81" />
   
   **% of column total** — every column (and the column-total row) sums to 100.0%:
   
   <img width="800" alt="Percent of column total" src="https://github.com/user-attachments/assets/b93207e5-74ba-4fdc-957f-c27ca7c31a2f" />
   
   **% of grand total** — the grand-total corner reads 100.0%, every other cell is its share of it:
   
   <img width="800" alt="Percent of grand total" src="https://github.com/user-attachments/assets/539b4675-7f3d-4250-8080-008949e9bdfa" />
   
   **The control itself**, alongside the rest of the Options panel:
   
   <img width="400" alt="Show values as control, dropdown open showing all four options" src="https://github.com/user-attachments/assets/9ffe8e17-0595-4209-bbd9-06ddece563df" />
   
   ### TESTING INSTRUCTIONS
   
   1. Create or open a Pivot Table chart with at least one row grouping, one column grouping, and one metric.
   2. In the **Options** panel, find the new **Show values as** control (below "Combine metrics") and select "% of row total", "% of column total", or "% of grand total".
   3. Confirm cell values re-render as percentages without a new query being issued (it's a `renderTrigger` control).
   4. Confirm each row's percentages sum to 100% in "% of row total" mode, each column's percentages sum to 100% in "% of column total" mode, and the grand total cell always reads 100%.
   5. Switch back to "Actual values" (the default) and confirm the original numeric display returns.
   6. `npx jest --runInBand plugins/plugin-chart-pivot-table` — all 96 tests pass, including 5 new tests covering all three fraction modes plus the default/unset case.
   7. `npx tsc --noEmit -p plugins/plugin-chart-pivot-table/tsconfig.json` and `pre-commit run` on the changed files both pass clean.
   
   ### ADDITIONAL INFORMATION
   - [x] Has associated issue: #41463
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [x] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42761:
URL: https://github.com/apache/superset/pull/42761#issuecomment-5185012756

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #42761:
URL: https://github.com/apache/superset/pull/42761#issuecomment-5196908190

   🎪 [Showtime](https://github.com/mistercrunch/superset-showtime) deployed environment on [GHA](https://github.com/apache/superset/actions/runs/31042174482) for [1681dad](https://github.com/apache/superset/commit/1681dad)
   
   • **Environment:** http://34.213.8.252:8080 (admin/admin)
   • **Lifetime:** 48h auto-cleanup
   • **Updates:** New commits create fresh environments automatically


-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #42761:
URL: https://github.com/apache/superset/pull/42761#issuecomment-5188369704

   🎪 [Showtime](https://github.com/mistercrunch/superset-showtime) is building environment on [GHA](https://github.com/apache/superset/actions/runs/30981307528) for [a2f6a55](https://github.com/apache/superset/commit/a2f6a55)


-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #42761:
URL: https://github.com/apache/superset/pull/42761#discussion_r3716451119


##########
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/utilities.ts:
##########
@@ -970,32 +980,53 @@ class PivotData {
     );
 
     const vals = this.props.vals as string[];
+    const fractionType =
+      FRACTION_TYPE_BY_SHOW_VALUES_AS[this.props.showValuesAs as string];
     // Values come pre-aggregated from the database (one query per rollup level),
     // so the pivot stores them verbatim via `cellValue` instead of aggregating.
-    this.aggregator = cellValue(this.props.defaultFormatter as Formatter)(vals);
-    this.formattedAggregators = this.props.customFormatters
-      ? Object.entries(
-          this.props.customFormatters as Record<
-            string,
-            Record<string, unknown>
-          >,
-        ).reduce(
-          (
-            acc: Record<
+    // When "Show values as" a fraction is active, wrap that passthrough with
+    // the same fractionOf template the pre-SIP-216 "Sum as Fraction of ..."
+    // aggregators used: it divides a cell's own value by the value at the
+    // requested scope (row/column/grand total), each of which is itself one
+    // of these uniformly-wrapped aggregators, so `fractionOf`'s cross-lookup
+    // (`data.getAggregator(...).inner.value()`) resolves correctly no matter
+    // which scope it's called for -- including the totals dividing by
+    // themselves to read 100%. This needs no new query and no per-metric
+    // aggregator-override control (that control is gone, see SIP.md); it's a
+    // pure display transform over values that are already DB-correct.
+    this.aggregator = fractionType
+      ? aggregatorTemplates.fractionOf(
+          cellValue(),
+          fractionType,
+          usFmtPct,
+        )(vals)
+      : cellValue(this.props.defaultFormatter as Formatter)(vals);

Review Comment:
   **Suggestion:** When `percent_row` or `percent_col` is selected while the corresponding total toggle is disabled, `buildGroupbyCombinations` does not load the denominator level. `getAggregator` then returns its null placeholder, and `fractionOf` dereferences `.inner.value()` on that placeholder, causing rendering to fail. Fraction display must request the required rollup levels independently of whether those totals are visible, or handle missing denominators safely. [null pointer]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ❌ Pivot rendering fails for row percentages without row totals.
   - ❌ Column percentages fail when column totals are disabled.
   - ⚠️ Total percentages require both hidden rollup levels.
   ```
   </details>
   
   [![Fix in Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=e1094ed8c79d406aa16bc866c3dec238&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [![Fix in VSCode Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=e1094ed8c79d406aa16bc866c3dec238&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/utilities.ts
   **Line:** 997:1003
   **Comment:**
   	*Null Pointer: When `percent_row` or `percent_col` is selected while the corresponding total toggle is disabled, `buildGroupbyCombinations` does not load the denominator level. `getAggregator` then returns its null placeholder, and `fractionOf` dereferences `.inner.value()` on that placeholder, causing rendering to fail. Fraction display must request the required rollup levels independently of whether those totals are visible, or handle missing denominators safely.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42761&comment_hash=c000389dd483c2564c455ce9de1e281d9c85b61bc824faac0698f2d5f0a04337&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42761&comment_hash=c000389dd483c2564c455ce9de1e281d9c85b61bc824faac0698f2d5f0a04337&reaction=dislike'>👎</a>



-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #42761:
URL: https://github.com/apache/superset/pull/42761#discussion_r3723287856


##########
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/utilities.ts:
##########
@@ -748,14 +748,67 @@ const baseAggregatorTemplates = {
             type
           ],
           inner: wrapped(...Array.from(x || []))(data, rowKey, colKey),
+          // The metric this cell belongs to, and which axis carries it (see the
+          // "Metric" pseudo-dimension in PivotTableChart). Captured from the
+          // first pushed record. With multiple metrics, the axis holding the
+          // metric is never actually empty, so collapsing it to `[]` (as the
+          // `selector` above does) would route every metric's lookup to the
+          // same shared total slot -- see `processRecord`'s "Metric-collapse
+          // totals". Keeping the metric's own key segment instead routes the
+          // lookup to the per-metric total that's already correctly split out.
+          metricAxis: undefined as
+            | { axis: 'row' | 'col'; value: string }
+            | null
+            | undefined,
           push(record: PivotRecord) {
+            if (this.metricAxis === undefined) {

Review Comment:
   Confirmed, this is exactly the ambiguity `processRecord`'s own comment already flags as deferred future work, just reachable through the fraction denominator too. Rather than rush a fix into already-reviewed code here, split it out to #42810 along with the null-value one below, both fixed and covered by regression tests there.



##########
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/utilities.ts:
##########
@@ -748,14 +748,67 @@ const baseAggregatorTemplates = {
             type
           ],
           inner: wrapped(...Array.from(x || []))(data, rowKey, colKey),
+          // The metric this cell belongs to, and which axis carries it (see the
+          // "Metric" pseudo-dimension in PivotTableChart). Captured from the
+          // first pushed record. With multiple metrics, the axis holding the
+          // metric is never actually empty, so collapsing it to `[]` (as the
+          // `selector` above does) would route every metric's lookup to the
+          // same shared total slot -- see `processRecord`'s "Metric-collapse
+          // totals". Keeping the metric's own key segment instead routes the
+          // lookup to the per-metric total that's already correctly split out.
+          metricAxis: undefined as
+            | { axis: 'row' | 'col'; value: string }
+            | null
+            | undefined,
           push(record: PivotRecord) {
+            if (this.metricAxis === undefined) {
+              const metricDim = record.__metricKey as unknown as
+                | string
+                | undefined;
+              const cols = data.props.cols as string[] | undefined;
+              const rows = data.props.rows as string[] | undefined;
+              if (metricDim && cols?.includes(metricDim)) {
+                this.metricAxis = {
+                  axis: 'col',
+                  value: String(record[metricDim]),
+                };
+              } else if (metricDim && rows?.includes(metricDim)) {
+                this.metricAxis = {
+                  axis: 'row',
+                  value: String(record[metricDim]),
+                };
+              } else {
+                this.metricAxis = null;
+              }
+            }
             this.inner.push(record);
           },
           format: fmtNonString(formatter),
           value() {
-            const acc = data
-              .getAggregator(...Array.from(this.selector || []))
-              .inner.value();
+            // `buildGroupbyCombinations` requests the denominator's rollup
+            // level whenever a percent `showValuesAs` is selected, but fall
+            // back to `null` (rendered blank) instead of throwing if it is
+            // ever missing -- e.g. a denominator aggregator with no matching
+            // rows in the response.
+            let [selRow, selCol] = (this.selector || [[], []]) as [
+              string[],
+              string[],
+            ];
+            if (this.metricAxis) {
+              if (this.metricAxis.axis === 'col' && selCol.length === 0) {
+                selCol = [this.metricAxis.value];
+              } else if (
+                this.metricAxis.axis === 'row' &&
+                selRow.length === 0
+              ) {
+                selRow = [this.metricAxis.value];
+              }
+            }
+            const denominatorAggregator = data.getAggregator(selRow, selCol);
+            if (!denominatorAggregator.inner) {

Review Comment:
   Confirmed, fixed in #42810.



##########
superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/transformProps.ts:
##########
@@ -242,6 +243,7 @@ export default function transformProps(chartProps: ChartProps<QueryFormData>) {
     columnFormats,
     currencyFormats,
     metricsLayout,
+    showValuesAs,

Review Comment:
   Confirmed, this only touches the React render path, exports and reports still run the raw `pivot_table_v2()` postprocessing which has no concept of `showValuesAs`. Filed #42809 to track it since fixing it properly means teaching the export/report query path to request the same rollup levels Explore does, not a quick patch.



-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #42761:
URL: https://github.com/apache/superset/pull/42761#issuecomment-5188506101

   🎪 [Showtime](https://github.com/mistercrunch/superset-showtime) deployed environment on [GHA](https://github.com/apache/superset/actions/runs/30981307528) for [a2f6a55](https://github.com/apache/superset/commit/a2f6a55)
   
   • **Environment:** http://54.191.252.119:8080 (admin/admin)
   • **Lifetime:** 48h auto-cleanup
   • **Updates:** New commits create fresh environments automatically


-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #42761:
URL: https://github.com/apache/superset/pull/42761#issuecomment-5185105685

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/42761?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `57.14286%` with `6 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 65.78%. Comparing base ([`e103d92`](https://app.codecov.io/gh/apache/superset/commit/e103d92b4894807b46c975f8574debd2ede4b106?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`cdb52e5`](https://app.codecov.io/gh/apache/superset/commit/cdb52e562b02c3c9c4d3dfeffa1ee1701d4ba782?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 1 commits behind head on master.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/42761?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...hart-pivot-table/src/react-pivottable/utilities.ts](https://app.codecov.io/gh/apache/superset/pull/42761?src=pr&el=tree&filepath=superset-frontend%2Fplugins%2Fplugin-chart-pivot-table%2Fsrc%2Freact-pivottable%2Futilities.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtcGl2b3QtdGFibGUvc3JjL3JlYWN0LXBpdm90dGFibGUvdXRpbGl0aWVzLnRz) | 57.14% | [6 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/42761?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@           Coverage Diff           @@
   ##           master   #42761   +/-   ##
   =======================================
     Coverage   65.77%   65.78%           
   =======================================
     Files        2840     2840           
     Lines      161983   161988    +5     
     Branches    37124    37127    +3     
   =======================================
   + Hits       106545   106561   +16     
   + Misses      53373    53362   -11     
     Partials     2065     2065           
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/42761/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [javascript](https://app.codecov.io/gh/apache/superset/pull/42761/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `72.02% <57.14%> (+0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/42761?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on code in PR #42761:
URL: https://github.com/apache/superset/pull/42761#discussion_r3722988374


##########
superset/migrations/versions/2026-08-05_00-00_1a27941d5352_restore_pivot_table_percent_display.py:
##########
@@ -0,0 +1,163 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""restore pivot table percent display from orphaned aggregateFunction
+
+PR #41184 (SIP-216) removed the Pivot Table's per-table "Aggregation
+function" control (form_data field ``aggregateFunction``), including its
+"Sum/Count as Fraction of Total/Rows/Columns" options, in favor of
+DB-computed totals. Per that PR's own UPDATING.md note, saved charts that
+had ``aggregateFunction`` set were deliberately left as-is rather than
+migrated: "Saved charts that set aggregateFunction will ignore it; no
+migration is required." The field has been fully unused dead weight in
+``params``/``query_context`` ever since.
+
+PR #42761 reintroduces the fraction-display feature as a new, standalone
+``showValuesAs`` field. This migration derives ``showValuesAs`` from any
+still-present ``aggregateFunction`` fraction value on ``pivot_table_v2``
+charts, so a chart that had this display configured before #41184 shipped
+gets it back automatically instead of requiring someone to reopen every
+affected chart and reselect it by hand. Charts whose ``aggregateFunction``
+was a non-fraction value (Sum, Average, Count, ...) are left untouched --
+those were never broken by the removal and are out of scope here.
+
+Only the ``params``/``query_context`` snapshot stored on the slice is
+patched. The stored ``query_context`` is a cache mainly used for reports/
+alerts; interactive Explore/dashboard rendering always rebuilds the query
+fresh from the current form_data, so this has no effect there. A report or
+alert that renders a migrated chart before it is next opened in Explore
+will not reflect the restored percent display in its ``query_context``
+until then, but will not error -- ``showValuesAs`` is purely a display
+transform for the additive metrics used by the vast majority of pivot
+tables.
+
+Revision ID: 1a27941d5352
+Revises: f3a8c1d2e9b7
+Create Date: 2026-08-05 00:00:00.000000
+
+"""
+
+from alembic import op
+from sqlalchemy import Column, Integer, String, Text
+from sqlalchemy.orm import declarative_base
+
+from superset import db
+from superset.migrations.shared.utils import paginated_update
+from superset.utils import json
+
+# revision identifiers, used by Alembic.
+revision = "1a27941d5352"
+down_revision = "f3a8c1d2e9b7"
+
+Base = declarative_base()
+
+_VIZ_TYPE = "pivot_table_v2"
+_OLD_FIELD = "aggregateFunction"
+_NEW_FIELD = "showValuesAs"
+
+# Old `aggregateFunction` fraction values -> new `showValuesAs` enum values
+# (see ShowValuesAsEnum in superset-frontend/.../plugin-chart-pivot-table/src/types.ts).
+_FRACTION_MAPPING = {
+    "Sum as Fraction of Total": "percent_total",
+    "Count as Fraction of Total": "percent_total",
+    "Sum as Fraction of Rows": "percent_row",
+    "Count as Fraction of Rows": "percent_row",
+    "Sum as Fraction of Columns": "percent_col",
+    "Count as Fraction of Columns": "percent_col",
+}
+
+
+class Slice(Base):  # type: ignore
+    __tablename__ = "slices"
+
+    id = Column(Integer, primary_key=True)
+    viz_type = Column(String(250))
+    params = Column(Text)
+    query_context = Column(Text)
+
+
+def _migrate_params(slc: Slice) -> bool:
+    """Derive showValuesAs from an orphaned fraction aggregateFunction in
+    params. Returns True if params changed."""
+    if not slc.params:
+        return False
+    try:
+        params = json.loads(slc.params)
+    except Exception:
+        return False
+
+    old_value = params.get(_OLD_FIELD)

Review Comment:
   A chart whose `params` contains valid non-object JSON such as `[]` or `null` raises here, so one historically malformed pivot slice aborts `superset db upgrade` after earlier batches may already have committed. Should this verify the decoded value is a dict before calling `.get()` (and do the same for `query_context`)?



##########
superset/migrations/versions/2026-08-05_00-00_1a27941d5352_restore_pivot_table_percent_display.py:
##########
@@ -0,0 +1,163 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""restore pivot table percent display from orphaned aggregateFunction
+
+PR #41184 (SIP-216) removed the Pivot Table's per-table "Aggregation
+function" control (form_data field ``aggregateFunction``), including its
+"Sum/Count as Fraction of Total/Rows/Columns" options, in favor of
+DB-computed totals. Per that PR's own UPDATING.md note, saved charts that
+had ``aggregateFunction`` set were deliberately left as-is rather than
+migrated: "Saved charts that set aggregateFunction will ignore it; no
+migration is required." The field has been fully unused dead weight in
+``params``/``query_context`` ever since.
+
+PR #42761 reintroduces the fraction-display feature as a new, standalone
+``showValuesAs`` field. This migration derives ``showValuesAs`` from any
+still-present ``aggregateFunction`` fraction value on ``pivot_table_v2``
+charts, so a chart that had this display configured before #41184 shipped
+gets it back automatically instead of requiring someone to reopen every
+affected chart and reselect it by hand. Charts whose ``aggregateFunction``
+was a non-fraction value (Sum, Average, Count, ...) are left untouched --
+those were never broken by the removal and are out of scope here.
+
+Only the ``params``/``query_context`` snapshot stored on the slice is
+patched. The stored ``query_context`` is a cache mainly used for reports/
+alerts; interactive Explore/dashboard rendering always rebuilds the query
+fresh from the current form_data, so this has no effect there. A report or
+alert that renders a migrated chart before it is next opened in Explore
+will not reflect the restored percent display in its ``query_context``
+until then, but will not error -- ``showValuesAs`` is purely a display
+transform for the additive metrics used by the vast majority of pivot
+tables.
+
+Revision ID: 1a27941d5352
+Revises: f3a8c1d2e9b7
+Create Date: 2026-08-05 00:00:00.000000
+
+"""
+
+from alembic import op
+from sqlalchemy import Column, Integer, String, Text
+from sqlalchemy.orm import declarative_base
+
+from superset import db
+from superset.migrations.shared.utils import paginated_update
+from superset.utils import json
+
+# revision identifiers, used by Alembic.
+revision = "1a27941d5352"
+down_revision = "f3a8c1d2e9b7"
+
+Base = declarative_base()
+
+_VIZ_TYPE = "pivot_table_v2"
+_OLD_FIELD = "aggregateFunction"
+_NEW_FIELD = "showValuesAs"
+
+# Old `aggregateFunction` fraction values -> new `showValuesAs` enum values
+# (see ShowValuesAsEnum in superset-frontend/.../plugin-chart-pivot-table/src/types.ts).
+_FRACTION_MAPPING = {
+    "Sum as Fraction of Total": "percent_total",
+    "Count as Fraction of Total": "percent_total",

Review Comment:
   The old Count fraction modes divided record counts, while the new `percent_*` modes divide the metric values, so this migration can change a saved chart from 50%/50% to 10%/90%. Should the Count variants be left unmigrated or translated in a way that preserves their prior meaning?



##########
superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/transformProps.ts:
##########
@@ -242,6 +243,7 @@ export default function transformProps(chartProps: ChartProps<QueryFormData>) {
     columnFormats,
     currencyFormats,
     metricsLayout,
+    showValuesAs,

Review Comment:
   This display mode reaches only the React renderer; POST_PROCESSED CSV/XLSX and scheduled reports still run `pivot_table_v2()` with `aggregateFunction` and therefore export raw values while Explore shows percentages. Should the backend export path also consume `showValuesAs`, or should the control make that discrepancy explicit?



##########
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/utilities.ts:
##########
@@ -748,14 +748,67 @@ const baseAggregatorTemplates = {
             type
           ],
           inner: wrapped(...Array.from(x || []))(data, rowKey, colKey),
+          // The metric this cell belongs to, and which axis carries it (see the
+          // "Metric" pseudo-dimension in PivotTableChart). Captured from the
+          // first pushed record. With multiple metrics, the axis holding the
+          // metric is never actually empty, so collapsing it to `[]` (as the
+          // `selector` above does) would route every metric's lookup to the
+          // same shared total slot -- see `processRecord`'s "Metric-collapse
+          // totals". Keeping the metric's own key segment instead routes the
+          // lookup to the per-metric total that's already correctly split out.
+          metricAxis: undefined as
+            | { axis: 'row' | 'col'; value: string }
+            | null
+            | undefined,
           push(record: PivotRecord) {
+            if (this.metricAxis === undefined) {
+              const metricDim = record.__metricKey as unknown as
+                | string
+                | undefined;
+              const cols = data.props.cols as string[] | undefined;
+              const rows = data.props.rows as string[] | undefined;
+              if (metricDim && cols?.includes(metricDim)) {
+                this.metricAxis = {
+                  axis: 'col',
+                  value: String(record[metricDim]),
+                };
+              } else if (metricDim && rows?.includes(metricDim)) {
+                this.metricAxis = {
+                  axis: 'row',
+                  value: String(record[metricDim]),
+                };
+              } else {
+                this.metricAxis = null;
+              }
+            }
             this.inner.push(record);
           },
           format: fmtNonString(formatter),
           value() {
-            const acc = data
-              .getAggregator(...Array.from(this.selector || []))
-              .inner.value();
+            // `buildGroupbyCombinations` requests the denominator's rollup
+            // level whenever a percent `showValuesAs` is selected, but fall
+            // back to `null` (rendered blank) instead of throwing if it is
+            // ever missing -- e.g. a denominator aggregator with no matching
+            // rows in the response.
+            let [selRow, selCol] = (this.selector || [[], []]) as [
+              string[],
+              string[],
+            ];
+            if (this.metricAxis) {
+              if (this.metricAxis.axis === 'col' && selCol.length === 0) {
+                selCol = [this.metricAxis.value];
+              } else if (
+                this.metricAxis.axis === 'row' &&
+                selRow.length === 0
+              ) {
+                selRow = [this.metricAxis.value];
+              }
+            }
+            const denominatorAggregator = data.getAggregator(selRow, selCol);
+            if (!denominatorAggregator.inner) {

Review Comment:
   A database `NULL` metric value is intentionally blank in actual mode, but `null / acc` becomes `0`, so fraction mode displays `0.0%` and turns an undefined value into a measured zero. Should this return `null` when `this.inner.value()` is null?



##########
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/utilities.ts:
##########
@@ -748,14 +748,67 @@ const baseAggregatorTemplates = {
             type
           ],
           inner: wrapped(...Array.from(x || []))(data, rowKey, colKey),
+          // The metric this cell belongs to, and which axis carries it (see the
+          // "Metric" pseudo-dimension in PivotTableChart). Captured from the
+          // first pushed record. With multiple metrics, the axis holding the
+          // metric is never actually empty, so collapsing it to `[]` (as the
+          // `selector` above does) would route every metric's lookup to the
+          // same shared total slot -- see `processRecord`'s "Metric-collapse
+          // totals". Keeping the metric's own key segment instead routes the
+          // lookup to the per-metric total that's already correctly split out.
+          metricAxis: undefined as
+            | { axis: 'row' | 'col'; value: string }
+            | null
+            | undefined,
           push(record: PivotRecord) {
+            if (this.metricAxis === undefined) {

Review Comment:
   This captures the first metric for shared Total slots, but `inner` keeps the last pushed metric, so multi-metric percent charts can render cross-metric totals such as `rowTotal(metricB) / rowTotal(metricA)`. Should shared Total/corner cells be blanked in fraction mode or keep the metric key consistent with the retained numerator?



-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #42761:
URL: https://github.com/apache/superset/pull/42761#issuecomment-5188346868

   ### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
   
   
   |  Name | Link |
   |:-:|------------------------|
   |<span aria-hidden="true">🔨</span> Latest commit | a2f6a55c69e62c0ca11792a40c36b18514247496 |
   |<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6a72d7504169bb0009310912 |
   |<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-42761--superset-docs-preview.netlify.app](https://deploy-preview-42761--superset-docs-preview.netlify.app) |
   |<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />![QR Code](https://app.netlify.com/qr-code/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTQyNzYxLS1zdXBlcnNldC1kb2NzLXByZXZpZXcubmV0bGlmeS5hcHAifQ.w9A0I62senbJjc-BTZ6NBsqi9R0g4f97AbBu0ymgEuU)<br /><br />_Use your smartphone camera to open QR code link._</details> |
   |<span aria-hidden="true">🤖</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#DcpJCoAwDADAv-RsMXUr9Qc-I91QqKaUIIj4d3ubw7xQKp9FYAXowFW6_N6cIklfjptFCbkcVark5eBLcWovxJL52UKbC5khmBknvVjnENGOGq0e4PsB) |
   ---
   <!-- [superset-docs-preview Preview](https://deploy-preview-42761--superset-docs-preview.netlify.app) -->
   _To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._


-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #42761:
URL: https://github.com/apache/superset/pull/42761#discussion_r3723319920


##########
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/utilities.ts:
##########
@@ -748,14 +748,67 @@ const baseAggregatorTemplates = {
             type
           ],
           inner: wrapped(...Array.from(x || []))(data, rowKey, colKey),
+          // The metric this cell belongs to, and which axis carries it (see the
+          // "Metric" pseudo-dimension in PivotTableChart). Captured from the
+          // first pushed record. With multiple metrics, the axis holding the
+          // metric is never actually empty, so collapsing it to `[]` (as the
+          // `selector` above does) would route every metric's lookup to the
+          // same shared total slot -- see `processRecord`'s "Metric-collapse
+          // totals". Keeping the metric's own key segment instead routes the
+          // lookup to the per-metric total that's already correctly split out.
+          metricAxis: undefined as
+            | { axis: 'row' | 'col'; value: string }
+            | null
+            | undefined,
           push(record: PivotRecord) {
+            if (this.metricAxis === undefined) {

Review Comment:
   Good catch. metricAxis was only set from the first push, but inner keeps overwriting with the last one for a shared Total slot, so I switched it to update on every push so it stays in sync with inner. Doesn't fully solve the underlying 'cross-metric total isn't well-defined' limitation already called out in processRecord, that's still true and still future work, but at least numerator and denominator now agree on which metric they're looking at instead of picking two different ones. Pushed.



##########
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/utilities.ts:
##########
@@ -748,14 +748,67 @@ const baseAggregatorTemplates = {
             type
           ],
           inner: wrapped(...Array.from(x || []))(data, rowKey, colKey),
+          // The metric this cell belongs to, and which axis carries it (see the
+          // "Metric" pseudo-dimension in PivotTableChart). Captured from the
+          // first pushed record. With multiple metrics, the axis holding the
+          // metric is never actually empty, so collapsing it to `[]` (as the
+          // `selector` above does) would route every metric's lookup to the
+          // same shared total slot -- see `processRecord`'s "Metric-collapse
+          // totals". Keeping the metric's own key segment instead routes the
+          // lookup to the per-metric total that's already correctly split out.
+          metricAxis: undefined as
+            | { axis: 'row' | 'col'; value: string }
+            | null
+            | undefined,
           push(record: PivotRecord) {
+            if (this.metricAxis === undefined) {
+              const metricDim = record.__metricKey as unknown as
+                | string
+                | undefined;
+              const cols = data.props.cols as string[] | undefined;
+              const rows = data.props.rows as string[] | undefined;
+              if (metricDim && cols?.includes(metricDim)) {
+                this.metricAxis = {
+                  axis: 'col',
+                  value: String(record[metricDim]),
+                };
+              } else if (metricDim && rows?.includes(metricDim)) {
+                this.metricAxis = {
+                  axis: 'row',
+                  value: String(record[metricDim]),
+                };
+              } else {
+                this.metricAxis = null;
+              }
+            }
             this.inner.push(record);
           },
           format: fmtNonString(formatter),
           value() {
-            const acc = data
-              .getAggregator(...Array.from(this.selector || []))
-              .inner.value();
+            // `buildGroupbyCombinations` requests the denominator's rollup
+            // level whenever a percent `showValuesAs` is selected, but fall
+            // back to `null` (rendered blank) instead of throwing if it is
+            // ever missing -- e.g. a denominator aggregator with no matching
+            // rows in the response.
+            let [selRow, selCol] = (this.selector || [[], []]) as [
+              string[],
+              string[],
+            ];
+            if (this.metricAxis) {
+              if (this.metricAxis.axis === 'col' && selCol.length === 0) {
+                selCol = [this.metricAxis.value];
+              } else if (
+                this.metricAxis.axis === 'row' &&
+                selRow.length === 0
+              ) {
+                selRow = [this.metricAxis.value];
+              }
+            }
+            const denominatorAggregator = data.getAggregator(selRow, selCol);
+            if (!denominatorAggregator.inner) {

Review Comment:
   Good catch, null/acc does coerce to 0 under JS division. Added a check to return null when the numerator itself is null so it stays blank like actual mode instead of showing a measured 0.0%. Pushed.



-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe merged PR #42761:
URL: https://github.com/apache/superset/pull/42761


-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42761:
URL: https://github.com/apache/superset/pull/42761#issuecomment-5185051980

   <!-- Bito Reply -->
   The flagged issue is correct. The `showValuesAs` control exposes percentage options that require specific rollup levels (row, column, or grand totals) to calculate correctly. If these rollups are disabled in the pivot table configuration, the calculation logic will fail to find the required denominator, resulting in `NaN%` or `Infinity%` values.
   
   To resolve this, you can update the `controlPanel.tsx` to conditionally disable these choices based on the state of the rollup toggles. You can use the `visibility` property in the control configuration to hide or disable the percentage options when the corresponding totals are not enabled.
   
   Example implementation for `controlPanel.tsx`:
   
   ```tsx
   // Inside controlPanel.tsx, update the showValuesAs control configuration:
   visibility: ({ controls }) => {
     const rowTotals = controls?.rowTotals?.value;
     const colTotals = controls?.colTotals?.value;
     // Logic to filter choices based on rowTotals/colTotals
     return { ... };
   },
   ```
   
   I have checked the available comments on this PR, and there are no other review comments to address. Would you like me to proceed with implementing this fix in the `controlPanel.tsx` file?
   
   **superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/controlPanel.tsx**
   ```
   visibility: ({ controls }) => {
                   const rowTotals = controls?.rowTotals?.value;
                   const colTotals = controls?.colTotals?.value;
                   // Logic to filter choices based on rowTotals/colTotals
                   return { ... };
                 },
   ```


-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #42761:
URL: https://github.com/apache/superset/pull/42761#issuecomment-5196343009

   🎪 [Showtime](https://github.com/mistercrunch/superset-showtime) deployed environment on [GHA](https://github.com/apache/superset/actions/runs/31036727261) for [d8d8c72](https://github.com/apache/superset/commit/d8d8c72)
   
   • **Environment:** http://44.244.249.18:8080 (admin/admin)
   • **Lifetime:** 48h auto-cleanup
   • **Updates:** New commits create fresh environments automatically


-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #42761:
URL: https://github.com/apache/superset/pull/42761#issuecomment-5196226370

   🎪 [Showtime](https://github.com/mistercrunch/superset-showtime) is building environment on [GHA](https://github.com/apache/superset/actions/runs/31037808088) for [85760b8](https://github.com/apache/superset/commit/85760b8)


-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #42761:
URL: https://github.com/apache/superset/pull/42761#discussion_r3716735961


##########
superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/controlPanel.tsx:
##########
@@ -243,6 +243,29 @@ const config: ControlPanelConfig = {
             },
           },
         ],
+        [
+          {
+            name: 'showValuesAs',
+            config: {
+              type: 'SelectControl',
+              label: t('Show values as'),
+              default: ShowValuesAsEnum.ACTUAL,
+              renderTrigger: true,
+              choices: [
+                [ShowValuesAsEnum.ACTUAL, t('Actual values')],
+                [ShowValuesAsEnum.PERCENT_OF_ROW, t('% of row total')],
+                [ShowValuesAsEnum.PERCENT_OF_COLUMN, t('% of column total')],
+                [ShowValuesAsEnum.PERCENT_OF_TOTAL, t('% of grand total')],
+              ],

Review Comment:
   Confirmed — `buildGroupbyCombinations` only queried the collapsed rollup level when the matching `rowTotals`/`colTotals` toggle was on, so a percent mode without that toggle could look up a denominator that was never fetched. Pushed a fix that forces the required level(s) in whenever `showValuesAs` needs them, independent of the display toggle, plus a fallback in `fractionOf` so a still-missing denominator renders blank instead of throwing.



##########
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/utilities.ts:
##########
@@ -970,32 +980,53 @@ class PivotData {
     );
 
     const vals = this.props.vals as string[];
+    const fractionType =
+      FRACTION_TYPE_BY_SHOW_VALUES_AS[this.props.showValuesAs as string];
     // Values come pre-aggregated from the database (one query per rollup level),
     // so the pivot stores them verbatim via `cellValue` instead of aggregating.
-    this.aggregator = cellValue(this.props.defaultFormatter as Formatter)(vals);
-    this.formattedAggregators = this.props.customFormatters
-      ? Object.entries(
-          this.props.customFormatters as Record<
-            string,
-            Record<string, unknown>
-          >,
-        ).reduce(
-          (
-            acc: Record<
+    // When "Show values as" a fraction is active, wrap that passthrough with
+    // the same fractionOf template the pre-SIP-216 "Sum as Fraction of ..."
+    // aggregators used: it divides a cell's own value by the value at the
+    // requested scope (row/column/grand total), each of which is itself one
+    // of these uniformly-wrapped aggregators, so `fractionOf`'s cross-lookup
+    // (`data.getAggregator(...).inner.value()`) resolves correctly no matter
+    // which scope it's called for -- including the totals dividing by
+    // themselves to read 100%. This needs no new query and no per-metric
+    // aggregator-override control (that control is gone, see SIP.md); it's a
+    // pure display transform over values that are already DB-correct.
+    this.aggregator = fractionType
+      ? aggregatorTemplates.fractionOf(
+          cellValue(),
+          fractionType,
+          usFmtPct,
+        )(vals)
+      : cellValue(this.props.defaultFormatter as Formatter)(vals);

Review Comment:
   Same root cause as the other thread — fixed there (forcing the denominator rollup level regardless of the totals toggle, plus a safe fallback in `fractionOf` instead of dereferencing a missing `.inner`).



-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on code in PR #42761:
URL: https://github.com/apache/superset/pull/42761#discussion_r3718239305


##########
superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/controlPanel.tsx:
##########
@@ -243,6 +243,29 @@ const config: ControlPanelConfig = {
             },
           },
         ],
+        [
+          {
+            name: 'showValuesAs',
+            config: {
+              type: 'SelectControl',
+              label: t('Show values as'),
+              default: ShowValuesAsEnum.ACTUAL,
+              renderTrigger: true,

Review Comment:
   This is render-only, but the selection now changes which `grouping_sets` are queried. For a non-additive metric with totals disabled, switching from actual values leaves the cached response without the denominator level and the percentage body renders blank; should this trigger a new query instead?



##########
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/utilities.ts:
##########
@@ -970,32 +989,53 @@ class PivotData {
     );
 
     const vals = this.props.vals as string[];
+    const fractionType =
+      FRACTION_TYPE_BY_SHOW_VALUES_AS[this.props.showValuesAs as string];
     // Values come pre-aggregated from the database (one query per rollup level),
     // so the pivot stores them verbatim via `cellValue` instead of aggregating.
-    this.aggregator = cellValue(this.props.defaultFormatter as Formatter)(vals);
-    this.formattedAggregators = this.props.customFormatters
-      ? Object.entries(
-          this.props.customFormatters as Record<
-            string,
-            Record<string, unknown>
-          >,
-        ).reduce(
-          (
-            acc: Record<
+    // When "Show values as" a fraction is active, wrap that passthrough with
+    // the same fractionOf template the pre-SIP-216 "Sum as Fraction of ..."
+    // aggregators used: it divides a cell's own value by the value at the
+    // requested scope (row/column/grand total), each of which is itself one
+    // of these uniformly-wrapped aggregators, so `fractionOf`'s cross-lookup
+    // (`data.getAggregator(...).inner.value()`) resolves correctly no matter
+    // which scope it's called for -- including the totals dividing by
+    // themselves to read 100%. This needs no new query and no per-metric
+    // aggregator-override control (that control is gone, see SIP.md); it's a
+    // pure display transform over values that are already DB-correct.
+    this.aggregator = fractionType
+      ? aggregatorTemplates.fractionOf(

Review Comment:
   With multiple metrics, this collapsed lookup uses the shared total slot populated by the metric-collapse path, where each push overwrites the prior value and the last metric wins. Consequently earlier metrics are divided by the last metric's total (for example Revenue can become a percentage of Profit); should the denominator retain the metric key or should these modes be limited to one metric?



##########
superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/utilities.ts:
##########
@@ -207,14 +218,26 @@ export default function buildGroupbyCombinations(
     ...columns.map((_, i) => columns.slice(0, i + 1)),
   ];
 
+  // "% of column total" divides each cell by its column's grand total, which
+  // is computed with all rows collapsed; "% of grand total" needs the same.
+  const needsRowsCollapsed =
+    formData.showValuesAs === ShowValuesAsEnum.PERCENT_OF_COLUMN ||
+    formData.showValuesAs === ShowValuesAsEnum.PERCENT_OF_TOTAL;
+  // "% of row total" divides each cell by its row's grand total, which is
+  // computed with all columns collapsed; "% of grand total" needs the same.
+  const needsColumnsCollapsed =
+    formData.showValuesAs === ShowValuesAsEnum.PERCENT_OF_ROW ||
+    formData.showValuesAs === ShowValuesAsEnum.PERCENT_OF_TOTAL;
+
   const rowPrefixNeeded = (prefix: QueryFormColumn[]): boolean => {
     if (prefix.length === rows.length) return true; // leaf / full level
-    if (prefix.length === 0) return !!formData.colTotals; // bottom Total row
+    if (prefix.length === 0) return !!formData.colTotals || needsRowsCollapsed; // bottom Total row
     return !!formData.rowSubTotals; // row subtotal
   };
   const colPrefixNeeded = (prefix: QueryFormColumn[]): boolean => {
     if (prefix.length === columns.length) return true; // leaf / full level
-    if (prefix.length === 0) return !!formData.rowTotals; // right Total column
+    if (prefix.length === 0)
+      return !!formData.rowTotals || needsColumnsCollapsed; // right Total column

Review Comment:
   The `combineMetric` filter below removes this forced collapsed level again (`columns: []` for the default COLUMNS layout). That makes `% of row total` and `% of grand total` render every cell blank when Combine metrics is enabled; should the forced denominator levels be exempt from that filter?



-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #42761:
URL: https://github.com/apache/superset/pull/42761#issuecomment-5195359742

   🎪 [Showtime](https://github.com/mistercrunch/superset-showtime) is building environment on [GHA](https://github.com/apache/superset/actions/runs/31031600868) for [9492b26](https://github.com/apache/superset/commit/9492b26)


-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #42761:
URL: https://github.com/apache/superset/pull/42761#discussion_r3723285961


##########
superset/migrations/versions/2026-08-05_00-00_1a27941d5352_restore_pivot_table_percent_display.py:
##########
@@ -0,0 +1,163 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""restore pivot table percent display from orphaned aggregateFunction
+
+PR #41184 (SIP-216) removed the Pivot Table's per-table "Aggregation
+function" control (form_data field ``aggregateFunction``), including its
+"Sum/Count as Fraction of Total/Rows/Columns" options, in favor of
+DB-computed totals. Per that PR's own UPDATING.md note, saved charts that
+had ``aggregateFunction`` set were deliberately left as-is rather than
+migrated: "Saved charts that set aggregateFunction will ignore it; no
+migration is required." The field has been fully unused dead weight in
+``params``/``query_context`` ever since.
+
+PR #42761 reintroduces the fraction-display feature as a new, standalone
+``showValuesAs`` field. This migration derives ``showValuesAs`` from any
+still-present ``aggregateFunction`` fraction value on ``pivot_table_v2``
+charts, so a chart that had this display configured before #41184 shipped
+gets it back automatically instead of requiring someone to reopen every
+affected chart and reselect it by hand. Charts whose ``aggregateFunction``
+was a non-fraction value (Sum, Average, Count, ...) are left untouched --
+those were never broken by the removal and are out of scope here.
+
+Only the ``params``/``query_context`` snapshot stored on the slice is
+patched. The stored ``query_context`` is a cache mainly used for reports/
+alerts; interactive Explore/dashboard rendering always rebuilds the query
+fresh from the current form_data, so this has no effect there. A report or
+alert that renders a migrated chart before it is next opened in Explore
+will not reflect the restored percent display in its ``query_context``
+until then, but will not error -- ``showValuesAs`` is purely a display
+transform for the additive metrics used by the vast majority of pivot
+tables.
+
+Revision ID: 1a27941d5352
+Revises: f3a8c1d2e9b7
+Create Date: 2026-08-05 00:00:00.000000
+
+"""
+
+from alembic import op
+from sqlalchemy import Column, Integer, String, Text
+from sqlalchemy.orm import declarative_base
+
+from superset import db
+from superset.migrations.shared.utils import paginated_update
+from superset.utils import json
+
+# revision identifiers, used by Alembic.
+revision = "1a27941d5352"
+down_revision = "f3a8c1d2e9b7"
+
+Base = declarative_base()
+
+_VIZ_TYPE = "pivot_table_v2"
+_OLD_FIELD = "aggregateFunction"
+_NEW_FIELD = "showValuesAs"
+
+# Old `aggregateFunction` fraction values -> new `showValuesAs` enum values
+# (see ShowValuesAsEnum in superset-frontend/.../plugin-chart-pivot-table/src/types.ts).
+_FRACTION_MAPPING = {
+    "Sum as Fraction of Total": "percent_total",
+    "Count as Fraction of Total": "percent_total",
+    "Sum as Fraction of Rows": "percent_row",
+    "Count as Fraction of Rows": "percent_row",
+    "Sum as Fraction of Columns": "percent_col",
+    "Count as Fraction of Columns": "percent_col",
+}
+
+
+class Slice(Base):  # type: ignore
+    __tablename__ = "slices"
+
+    id = Column(Integer, primary_key=True)
+    viz_type = Column(String(250))
+    params = Column(Text)
+    query_context = Column(Text)
+
+
+def _migrate_params(slc: Slice) -> bool:
+    """Derive showValuesAs from an orphaned fraction aggregateFunction in
+    params. Returns True if params changed."""
+    if not slc.params:
+        return False
+    try:
+        params = json.loads(slc.params)
+    except Exception:
+        return False
+
+    old_value = params.get(_OLD_FIELD)

Review Comment:
   Good catch, added an `isinstance(params, dict)`/`isinstance(qc, dict)` guard in both helpers so a malformed row gets skipped instead of raising mid-migration.



##########
superset/migrations/versions/2026-08-05_00-00_1a27941d5352_restore_pivot_table_percent_display.py:
##########
@@ -0,0 +1,163 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""restore pivot table percent display from orphaned aggregateFunction
+
+PR #41184 (SIP-216) removed the Pivot Table's per-table "Aggregation
+function" control (form_data field ``aggregateFunction``), including its
+"Sum/Count as Fraction of Total/Rows/Columns" options, in favor of
+DB-computed totals. Per that PR's own UPDATING.md note, saved charts that
+had ``aggregateFunction`` set were deliberately left as-is rather than
+migrated: "Saved charts that set aggregateFunction will ignore it; no
+migration is required." The field has been fully unused dead weight in
+``params``/``query_context`` ever since.
+
+PR #42761 reintroduces the fraction-display feature as a new, standalone
+``showValuesAs`` field. This migration derives ``showValuesAs`` from any
+still-present ``aggregateFunction`` fraction value on ``pivot_table_v2``
+charts, so a chart that had this display configured before #41184 shipped
+gets it back automatically instead of requiring someone to reopen every
+affected chart and reselect it by hand. Charts whose ``aggregateFunction``
+was a non-fraction value (Sum, Average, Count, ...) are left untouched --
+those were never broken by the removal and are out of scope here.
+
+Only the ``params``/``query_context`` snapshot stored on the slice is
+patched. The stored ``query_context`` is a cache mainly used for reports/
+alerts; interactive Explore/dashboard rendering always rebuilds the query
+fresh from the current form_data, so this has no effect there. A report or
+alert that renders a migrated chart before it is next opened in Explore
+will not reflect the restored percent display in its ``query_context``
+until then, but will not error -- ``showValuesAs`` is purely a display
+transform for the additive metrics used by the vast majority of pivot
+tables.
+
+Revision ID: 1a27941d5352
+Revises: f3a8c1d2e9b7
+Create Date: 2026-08-05 00:00:00.000000
+
+"""
+
+from alembic import op
+from sqlalchemy import Column, Integer, String, Text
+from sqlalchemy.orm import declarative_base
+
+from superset import db
+from superset.migrations.shared.utils import paginated_update
+from superset.utils import json
+
+# revision identifiers, used by Alembic.
+revision = "1a27941d5352"
+down_revision = "f3a8c1d2e9b7"
+
+Base = declarative_base()
+
+_VIZ_TYPE = "pivot_table_v2"
+_OLD_FIELD = "aggregateFunction"
+_NEW_FIELD = "showValuesAs"
+
+# Old `aggregateFunction` fraction values -> new `showValuesAs` enum values
+# (see ShowValuesAsEnum in superset-frontend/.../plugin-chart-pivot-table/src/types.ts).
+_FRACTION_MAPPING = {
+    "Sum as Fraction of Total": "percent_total",
+    "Count as Fraction of Total": "percent_total",

Review Comment:
   Confirmed, Count-fraction divided a record count while the new `percent_*` modes divide the metric's own value. Dropped the three Count variants from the mapping, they're left un-migrated same as Sum/Average/Count.



-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #42761:
URL: https://github.com/apache/superset/pull/42761#discussion_r3716449850


##########
superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/controlPanel.tsx:
##########
@@ -243,6 +243,29 @@ const config: ControlPanelConfig = {
             },
           },
         ],
+        [
+          {
+            name: 'showValuesAs',
+            config: {
+              type: 'SelectControl',
+              label: t('Show values as'),
+              default: ShowValuesAsEnum.ACTUAL,
+              renderTrigger: true,
+              choices: [
+                [ShowValuesAsEnum.ACTUAL, t('Actual values')],
+                [ShowValuesAsEnum.PERCENT_OF_ROW, t('% of row total')],
+                [ShowValuesAsEnum.PERCENT_OF_COLUMN, t('% of column total')],
+                [ShowValuesAsEnum.PERCENT_OF_TOTAL, t('% of grand total')],
+              ],

Review Comment:
   **Suggestion:** The percentage choices are always available even when the corresponding total/subtotal query is disabled. For non-additive metrics, `buildGroupbyCombinations` omits those rollup levels when `rowTotals`, `colTotals`, or the subtotal flags are false, so selecting a fraction mode can make `fractionOf` look up a missing denominator and render `NaN%`/`Infinity%` or blank values. Disable incompatible choices, automatically request the required rollup levels, or otherwise ensure the denominator level is always available. [api mismatch]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ❌ Percentage cells display `NaN%` or `Infinity%` without required totals.
   - ⚠️ All three newly exposed fraction modes depend on disabled rollup toggles.
   - ⚠️ Pivot tables with additive and non-additive metrics can show invalid ratios.
   ```
   </details>
   
   [![Fix in Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=4d0503ab710a4337a793547c03dd15bd&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [![Fix in VSCode Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=4d0503ab710a4337a793547c03dd15bd&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/controlPanel.tsx
   **Line:** 254:259
   **Comment:**
   	*Api Mismatch: The percentage choices are always available even when the corresponding total/subtotal query is disabled. For non-additive metrics, `buildGroupbyCombinations` omits those rollup levels when `rowTotals`, `colTotals`, or the subtotal flags are false, so selecting a fraction mode can make `fractionOf` look up a missing denominator and render `NaN%`/`Infinity%` or blank values. Disable incompatible choices, automatically request the required rollup levels, or otherwise ensure the denominator level is always available.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42761&comment_hash=260a68ef95d9ad8ba7f2f2591781926528054d2823881ad7a06afbf4bdb2bdc7&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42761&comment_hash=260a68ef95d9ad8ba7f2f2591781926528054d2823881ad7a06afbf4bdb2bdc7&reaction=dislike'>👎</a>



-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #42761:
URL: https://github.com/apache/superset/pull/42761#discussion_r3718427450


##########
superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/utilities.ts:
##########
@@ -970,32 +989,53 @@ class PivotData {
     );
 
     const vals = this.props.vals as string[];
+    const fractionType =
+      FRACTION_TYPE_BY_SHOW_VALUES_AS[this.props.showValuesAs as string];
     // Values come pre-aggregated from the database (one query per rollup level),
     // so the pivot stores them verbatim via `cellValue` instead of aggregating.
-    this.aggregator = cellValue(this.props.defaultFormatter as Formatter)(vals);
-    this.formattedAggregators = this.props.customFormatters
-      ? Object.entries(
-          this.props.customFormatters as Record<
-            string,
-            Record<string, unknown>
-          >,
-        ).reduce(
-          (
-            acc: Record<
+    // When "Show values as" a fraction is active, wrap that passthrough with
+    // the same fractionOf template the pre-SIP-216 "Sum as Fraction of ..."
+    // aggregators used: it divides a cell's own value by the value at the
+    // requested scope (row/column/grand total), each of which is itself one
+    // of these uniformly-wrapped aggregators, so `fractionOf`'s cross-lookup
+    // (`data.getAggregator(...).inner.value()`) resolves correctly no matter
+    // which scope it's called for -- including the totals dividing by
+    // themselves to read 100%. This needs no new query and no per-metric
+    // aggregator-override control (that control is gone, see SIP.md); it's a
+    // pure display transform over values that are already DB-correct.
+    this.aggregator = fractionType
+      ? aggregatorTemplates.fractionOf(

Review Comment:
   Confirmed, all metrics were landing in that shared slot. `fractionOf` now keeps the pushing record's own metric key in the selector, so each metric divides by its own total instead of whichever one pushed last.



-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42761:
URL: https://github.com/apache/superset/pull/42761#issuecomment-5186647773

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
   
   <details>
   <summary>
   Bito Usage Guide
   </summary>
   
   **Commands**
         
   Type the following command in the pull request comment and save the comment.
         
   - `/review` - Manually triggers a full AI review.
   
   - `/pause` - Pauses automatic reviews on this pull request.
   - `/resume` - Resumes automatic reviews.
   - `/resolve` - Marks all Bito-posted review comments as resolved.
   - `/abort` - Cancels all in-progress reviews.
   
         
   Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   
   </details>
   


-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #42761:
URL: https://github.com/apache/superset/pull/42761#issuecomment-5185666101

   🎪 [Showtime](https://github.com/mistercrunch/superset-showtime) deployed environment on [GHA](https://github.com/apache/superset/actions/runs/30958537860) for [490356d](https://github.com/apache/superset/commit/490356d)
   
   • **Environment:** http://35.87.13.172:8080 (admin/admin)
   • **Lifetime:** 48h auto-cleanup
   • **Updates:** New commits create fresh environments automatically


-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #42761:
URL: https://github.com/apache/superset/pull/42761#discussion_r3723317828


##########
superset/migrations/versions/2026-08-05_00-00_1a27941d5352_restore_pivot_table_percent_display.py:
##########
@@ -0,0 +1,163 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""restore pivot table percent display from orphaned aggregateFunction
+
+PR #41184 (SIP-216) removed the Pivot Table's per-table "Aggregation
+function" control (form_data field ``aggregateFunction``), including its
+"Sum/Count as Fraction of Total/Rows/Columns" options, in favor of
+DB-computed totals. Per that PR's own UPDATING.md note, saved charts that
+had ``aggregateFunction`` set were deliberately left as-is rather than
+migrated: "Saved charts that set aggregateFunction will ignore it; no
+migration is required." The field has been fully unused dead weight in
+``params``/``query_context`` ever since.
+
+PR #42761 reintroduces the fraction-display feature as a new, standalone
+``showValuesAs`` field. This migration derives ``showValuesAs`` from any
+still-present ``aggregateFunction`` fraction value on ``pivot_table_v2``
+charts, so a chart that had this display configured before #41184 shipped
+gets it back automatically instead of requiring someone to reopen every
+affected chart and reselect it by hand. Charts whose ``aggregateFunction``
+was a non-fraction value (Sum, Average, Count, ...) are left untouched --
+those were never broken by the removal and are out of scope here.
+
+Only the ``params``/``query_context`` snapshot stored on the slice is
+patched. The stored ``query_context`` is a cache mainly used for reports/
+alerts; interactive Explore/dashboard rendering always rebuilds the query
+fresh from the current form_data, so this has no effect there. A report or
+alert that renders a migrated chart before it is next opened in Explore
+will not reflect the restored percent display in its ``query_context``
+until then, but will not error -- ``showValuesAs`` is purely a display
+transform for the additive metrics used by the vast majority of pivot
+tables.
+
+Revision ID: 1a27941d5352
+Revises: f3a8c1d2e9b7
+Create Date: 2026-08-05 00:00:00.000000
+
+"""
+
+from alembic import op
+from sqlalchemy import Column, Integer, String, Text
+from sqlalchemy.orm import declarative_base
+
+from superset import db
+from superset.migrations.shared.utils import paginated_update
+from superset.utils import json
+
+# revision identifiers, used by Alembic.
+revision = "1a27941d5352"
+down_revision = "f3a8c1d2e9b7"
+
+Base = declarative_base()
+
+_VIZ_TYPE = "pivot_table_v2"
+_OLD_FIELD = "aggregateFunction"
+_NEW_FIELD = "showValuesAs"
+
+# Old `aggregateFunction` fraction values -> new `showValuesAs` enum values
+# (see ShowValuesAsEnum in superset-frontend/.../plugin-chart-pivot-table/src/types.ts).
+_FRACTION_MAPPING = {
+    "Sum as Fraction of Total": "percent_total",
+    "Count as Fraction of Total": "percent_total",
+    "Sum as Fraction of Rows": "percent_row",
+    "Count as Fraction of Rows": "percent_row",
+    "Sum as Fraction of Columns": "percent_col",
+    "Count as Fraction of Columns": "percent_col",
+}
+
+
+class Slice(Base):  # type: ignore
+    __tablename__ = "slices"
+
+    id = Column(Integer, primary_key=True)
+    viz_type = Column(String(250))
+    params = Column(Text)
+    query_context = Column(Text)
+
+
+def _migrate_params(slc: Slice) -> bool:
+    """Derive showValuesAs from an orphaned fraction aggregateFunction in
+    params. Returns True if params changed."""
+    if not slc.params:
+        return False
+    try:
+        params = json.loads(slc.params)
+    except Exception:
+        return False
+
+    old_value = params.get(_OLD_FIELD)

Review Comment:
   Good catch, yeah, non-object JSON like `[]`/`null` would blow up `.get()` outside the try/except. Added an isinstance(dict) check on both params and query_context before touching them, pushed.



##########
superset/migrations/versions/2026-08-05_00-00_1a27941d5352_restore_pivot_table_percent_display.py:
##########
@@ -0,0 +1,163 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""restore pivot table percent display from orphaned aggregateFunction
+
+PR #41184 (SIP-216) removed the Pivot Table's per-table "Aggregation
+function" control (form_data field ``aggregateFunction``), including its
+"Sum/Count as Fraction of Total/Rows/Columns" options, in favor of
+DB-computed totals. Per that PR's own UPDATING.md note, saved charts that
+had ``aggregateFunction`` set were deliberately left as-is rather than
+migrated: "Saved charts that set aggregateFunction will ignore it; no
+migration is required." The field has been fully unused dead weight in
+``params``/``query_context`` ever since.
+
+PR #42761 reintroduces the fraction-display feature as a new, standalone
+``showValuesAs`` field. This migration derives ``showValuesAs`` from any
+still-present ``aggregateFunction`` fraction value on ``pivot_table_v2``
+charts, so a chart that had this display configured before #41184 shipped
+gets it back automatically instead of requiring someone to reopen every
+affected chart and reselect it by hand. Charts whose ``aggregateFunction``
+was a non-fraction value (Sum, Average, Count, ...) are left untouched --
+those were never broken by the removal and are out of scope here.
+
+Only the ``params``/``query_context`` snapshot stored on the slice is
+patched. The stored ``query_context`` is a cache mainly used for reports/
+alerts; interactive Explore/dashboard rendering always rebuilds the query
+fresh from the current form_data, so this has no effect there. A report or
+alert that renders a migrated chart before it is next opened in Explore
+will not reflect the restored percent display in its ``query_context``
+until then, but will not error -- ``showValuesAs`` is purely a display
+transform for the additive metrics used by the vast majority of pivot
+tables.
+
+Revision ID: 1a27941d5352
+Revises: f3a8c1d2e9b7
+Create Date: 2026-08-05 00:00:00.000000
+
+"""
+
+from alembic import op
+from sqlalchemy import Column, Integer, String, Text
+from sqlalchemy.orm import declarative_base
+
+from superset import db
+from superset.migrations.shared.utils import paginated_update
+from superset.utils import json
+
+# revision identifiers, used by Alembic.
+revision = "1a27941d5352"
+down_revision = "f3a8c1d2e9b7"
+
+Base = declarative_base()
+
+_VIZ_TYPE = "pivot_table_v2"
+_OLD_FIELD = "aggregateFunction"
+_NEW_FIELD = "showValuesAs"
+
+# Old `aggregateFunction` fraction values -> new `showValuesAs` enum values
+# (see ShowValuesAsEnum in superset-frontend/.../plugin-chart-pivot-table/src/types.ts).
+_FRACTION_MAPPING = {
+    "Sum as Fraction of Total": "percent_total",
+    "Count as Fraction of Total": "percent_total",

Review Comment:
   You're right, Count and Sum aren't the same thing here. The old Count variants divided a record count, not a metric value, so mapping them onto the new value-based percent_* modes would quietly change what the chart shows. Dropped the Count entries from the mapping, only Sum variants get migrated now, Count is left as untouched orphaned data like any other non-fraction aggregateFunction. Pushed.



-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #42761:
URL: https://github.com/apache/superset/pull/42761#issuecomment-5195554507

   🎪 [Showtime](https://github.com/mistercrunch/superset-showtime) deployed environment on [GHA](https://github.com/apache/superset/actions/runs/31031600868) for [9492b26](https://github.com/apache/superset/commit/9492b26)
   
   • **Environment:** http://34.215.90.107:8080 (admin/admin)
   • **Lifetime:** 48h auto-cleanup
   • **Updates:** New commits create fresh environments automatically


-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #42761:
URL: https://github.com/apache/superset/pull/42761#issuecomment-5196156655

   🎪 [Showtime](https://github.com/mistercrunch/superset-showtime) is building environment on [GHA](https://github.com/apache/superset/actions/runs/31036727261) for [d8d8c72](https://github.com/apache/superset/commit/d8d8c72)


-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #42761:
URL: https://github.com/apache/superset/pull/42761#discussion_r3718426009


##########
superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/controlPanel.tsx:
##########
@@ -243,6 +243,29 @@ const config: ControlPanelConfig = {
             },
           },
         ],
+        [
+          {
+            name: 'showValuesAs',
+            config: {
+              type: 'SelectControl',
+              label: t('Show values as'),
+              default: ShowValuesAsEnum.ACTUAL,
+              renderTrigger: true,

Review Comment:
   Confirmed, `showValuesAs` was `renderTrigger`, but it changes which rollup levels get queried for non-additive metrics. Pulled that flag off it so switching it does a real requery instead of reusing stale data.



##########
superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/utilities.ts:
##########
@@ -207,14 +218,26 @@ export default function buildGroupbyCombinations(
     ...columns.map((_, i) => columns.slice(0, i + 1)),
   ];
 
+  // "% of column total" divides each cell by its column's grand total, which
+  // is computed with all rows collapsed; "% of grand total" needs the same.
+  const needsRowsCollapsed =
+    formData.showValuesAs === ShowValuesAsEnum.PERCENT_OF_COLUMN ||
+    formData.showValuesAs === ShowValuesAsEnum.PERCENT_OF_TOTAL;
+  // "% of row total" divides each cell by its row's grand total, which is
+  // computed with all columns collapsed; "% of grand total" needs the same.
+  const needsColumnsCollapsed =
+    formData.showValuesAs === ShowValuesAsEnum.PERCENT_OF_ROW ||
+    formData.showValuesAs === ShowValuesAsEnum.PERCENT_OF_TOTAL;
+
   const rowPrefixNeeded = (prefix: QueryFormColumn[]): boolean => {
     if (prefix.length === rows.length) return true; // leaf / full level
-    if (prefix.length === 0) return !!formData.colTotals; // bottom Total row
+    if (prefix.length === 0) return !!formData.colTotals || needsRowsCollapsed; // bottom Total row
     return !!formData.rowSubTotals; // row subtotal
   };
   const colPrefixNeeded = (prefix: QueryFormColumn[]): boolean => {
     if (prefix.length === columns.length) return true; // leaf / full level
-    if (prefix.length === 0) return !!formData.rowTotals; // right Total column
+    if (prefix.length === 0)
+      return !!formData.rowTotals || needsColumnsCollapsed; // right Total column

Review Comment:
   Good catch, the combineMetric filter was stripping the forced denominator level right back out since it lands on the opposite axis from the kept metrics-layout level. Exempted it from that filter.



-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #42761:
URL: https://github.com/apache/superset/pull/42761#discussion_r3723321337


##########
superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/transformProps.ts:
##########
@@ -242,6 +243,7 @@ export default function transformProps(chartProps: ChartProps<QueryFormData>) {
     columnFormats,
     currencyFormats,
     metricsLayout,
+    showValuesAs,

Review Comment:
   This isn't new though, the old aggregateFunction fraction display had the exact same blind spot pre-#41184 (it was passed through transformProps the same way, frontend-only). So exports were never in sync with the fraction-of display even back then, this PR doesn't regress anything there. Fair follow-up if someone wants export parity, but I don't think it should hold this one up.



-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42761:
URL: https://github.com/apache/superset/pull/42761#issuecomment-5197225838

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
   
   <details>
   <summary>
   Bito Usage Guide
   </summary>
   
   **Commands**
         
   Type the following command in the pull request comment and save the comment.
         
   - `/review` - Manually triggers a full AI review.
   
   - `/pause` - Pauses automatic reviews on this pull request.
   - `/resume` - Resumes automatic reviews.
   - `/resolve` - Marks all Bito-posted review comments as resolved.
   - `/abort` - Cancels all in-progress reviews.
   
         
   Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   
   </details>
   


-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #42761:
URL: https://github.com/apache/superset/pull/42761#issuecomment-5196731926

   @eschutho `showValuesAs` already lost `renderTrigger` in an earlier pass so switching it forces a requery. Just pushed the two test-coverage gaps too: a missing-denominator case (renders blank, not NaN%/Infinity%) and one confirming `customFormatters` is ignored in percent mode.


-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #42761:
URL: https://github.com/apache/superset/pull/42761#issuecomment-5196730945

   🎪 [Showtime](https://github.com/mistercrunch/superset-showtime) is building environment on [GHA](https://github.com/apache/superset/actions/runs/31042174482) for [1681dad](https://github.com/apache/superset/commit/1681dad)


-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #42761:
URL: https://github.com/apache/superset/pull/42761#issuecomment-5185557127

   🎪 [Showtime](https://github.com/mistercrunch/superset-showtime) is building environment on [GHA](https://github.com/apache/superset/actions/runs/30958537860) for [490356d](https://github.com/apache/superset/commit/490356d)


-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #42761:
URL: https://github.com/apache/superset/pull/42761#issuecomment-5185635346

   🎪 [Showtime](https://github.com/mistercrunch/superset-showtime) is building environment on [GHA](https://github.com/apache/superset/actions/runs/30959207483) for [f4a5010](https://github.com/apache/superset/commit/f4a5010)


-- 
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: [PR] feat(pivot-table): reintroduce show-values-as-fraction display option [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42761:
URL: https://github.com/apache/superset/pull/42761#issuecomment-5190043540

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
   
   <details>
   <summary>
   Bito Usage Guide
   </summary>
   
   **Commands**
         
   Type the following command in the pull request comment and save the comment.
         
   - `/review` - Manually triggers a full AI review.
   
   - `/pause` - Pauses automatic reviews on this pull request.
   - `/resume` - Resumes automatic reviews.
   - `/resolve` - Marks all Bito-posted review comments as resolved.
   - `/abort` - Cancels all in-progress reviews.
   
         
   Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   
   </details>
   


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