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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to