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

   ### SUMMARY
   
   A Bubble chart shows `<NULL>` in the legend when the dimension or bubble 
series is a Custom SQL column instead of a physical column. Every row collapses 
into a single `<NULL>` series.
   
   The transform indexed each data row with the raw form-data value for 
`entity` and `series`. For a physical column that value is the column name 
string, so the lookup works. For an adhoc (Custom SQL) column it is an object, 
so the key becomes `"[object Object]"`, never matches a returned column, and 
falls back to `<NULL>`. The x/y/size metrics already avoid this by resolving 
through `getMetricLabel`; the dimension columns were never resolved.
   
   The fix resolves `entity` and `series` through `getColumnLabel` before 
indexing the row, the same way Pie and other charts do it. Physical and 
dataset-calculated columns keep working unchanged.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   <!-- BEFORE: drag the before screenshot here (legend = single <NULL>) -->
   
   <!-- AFTER: drag the after screenshot here (legend = year values) -->
   
   ### TESTING INSTRUCTIONS
   
   1. Create a Bubble chart on a dataset with a date column (for example 
`birth_names`).
   2. Set the dimension (Entity) to a Custom SQL column such as `EXTRACT(YEAR 
FROM ds)`.
   3. Add metrics for the X axis, Y axis, and bubble size, then run the chart.
   4. Before this change the legend shows a single `<NULL>`. After, it shows 
the actual values (the years).
   
   Unit tests in `Bubble/transformProps.test.ts` cover an adhoc entity and an 
adhoc series.
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] 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
   - [ ] 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