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

   ## Summary
   
   This PR fixes issue #33245 where the heatmap chart's y-axis would display in 
random order when some data combinations were missing. Starting in version 4.1, 
the chart lost the ability to maintain proper axis ordering in these cases.
   
   ### Root Cause
   The new heatmap chart uses server-side ordering via SQL ORDER BY clauses. 
However, ECharts automatically creates axis categories from the data it 
receives, which doesn't preserve the intended order when data is sparse.
   
   ### Solution
   The fix explicitly sets axis categories in the correct order by:
   1. Extracting unique values for each axis from the data
   2. Sorting them according to the user's sorting configuration (alphabetical 
or by metric value)
   3. Explicitly setting the axis data in the ECharts configuration
   
   This ensures both axes maintain their proper order regardless of missing 
data combinations.
   
   ## Test plan
   
   Added comprehensive unit tests that verify:
   - Axes maintain alphabetical order when data is missing
   - Descending order works correctly
   - Sorting by metric value works as expected
   - Numeric values are sorted numerically (not as strings)
   - Original order is preserved when no sorting is specified
   - Null/undefined values are handled correctly
   
   ### Manual Testing
   1. Create a heatmap chart with sparse data (e.g., day of week vs hour with 
some combinations missing)
   2. Set both X and Y axis sorting to "Axis ascending"
   3. Verify both axes display in the correct order
   4. Test with different sorting options (descending, by metric value)
   
   ## Related Issues
   - Fixes #33245
   - Related to #33105 (original issue that was split)
   
   🤖 Generated with [Claude Code](https://claude.ai/code)


-- 
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-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to