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

   ### SUMMARY
   
   Since the SIP-216 additive fast-path (#41184), a pivot table whose metrics 
are all SIMPLE `SUM`/`COUNT`/`MIN`/`MAX` is rendered from one full-detail 
query, with every level re-derived in the browser by 
`synthesizeAdditiveLevels`. That reduction coerces each value with `Number()` 
and drops the rest, so a SIMPLE `MIN`/`MAX` over a text (or temporal) column 
renders empty cells; 6.1 displayed them. Fixes #45405.
   
   `isAdditiveMetric` now treats `MIN`/`MAX` as additive only when the metric's 
column is known to be numeric (`column.type_generic === 
GenericDataType.Numeric`). Any other or unknown column type takes the existing 
database rollup path, as SQL and saved metrics already do. `SUM`/`COUNT` are 
unchanged. The cost is one GROUPING SETS query instead of a plain one for those 
charts.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Same saved chart (Simple `MAX(display_value)` over a text column, metric 
name by month, no totals) on 7.0.0rc2 with stock assets vs. this branch.
   
   Before:
   
   <img width="1030" height="120" alt="before: text row blank" 
src="https://github.com/user-attachments/assets/640a81c3-91ba-4372-b30b-745a5832d003";
 />
   
   After:
   
   <img width="1030" height="120" alt="after: text row rendered" 
src="https://github.com/user-attachments/assets/13674ddc-c606-4810-a2a3-150fa918633c";
 />
   
   ### TESTING INSTRUCTIONS
   
   1. On any dataset with a string column, create a Pivot Table with a Simple 
`MAX(<string column>)` metric and run it. Before: empty cells. After: the text 
renders.
   2. A Simple `MAX` on a numeric column still issues a single query with no 
`grouping_sets`.
   3. `npx jest 
plugins/plugin-chart-pivot-table/test/plugin/utilities.test.ts`; the new case 
fails without the change.
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: Fixes #45405
   - [ ] Required feature flags:
   - [ ] 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
   - [ ] 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: [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