Bug description

nicholaslimck have already mentioned in 31318 about the problem with y axis sorting in echarts heatmap, but the issue was closed and fix 31752 doesn't help.

How to reproduce the bug: 1. Create new echarts heatmap chart 2. Choose columns for X and Y axis, some cells in heatmap should be empty. Image 3. Result Image

Values from 1 to 5 should be above 6 It seems that sorting calculation skipping y values where metric is null. It doesn't consider all range of values, only first x value.

Screenshots/recordings

More examples, when there are emplty values

Image

Superset version

4.1.1

Python version

3.9

Node version

16

Browser

Chrome

Additional context

Legacy heatmap sorting works correctly Image

Checklist

  • [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
  • [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
  • [ ] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Comment From: dosubot[bot]

A similar issue was previously reported in issue #31318, which was closed after a fix was implemented in pull request #31752. However, it seems that the fix did not resolve the problem for cases with empty cells in the heatmap [1].

The current logic for sorting the y-axis in the Echarts heatmap includes options for sorting by axis or metric in both ascending and descending order. However, it appears that the sorting logic may skip y-axis values where the metric is null, which could be causing the issue you're experiencing [2].

There are test cases in the Superset codebase that address sorting behavior with null or empty values, which might provide some insight into how these cases are handled. For example, the test cases in series.test.ts include scenarios with null values in the dataset [3].

If the legacy heatmap sorting works correctly, it might be worth comparing the logic between the legacy and current Echarts heatmap implementations to identify any differences that could be contributing to this issue [4].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

Comment From: sadpandajoe

@propellerjet when you say https://github.com/apache/superset/pull/31752 doesn't help, are you pulling from master or are you using 4.1.1? Currently 4.1.1 won't have the fix, I would see if 5.0.0rc1 has fixed the issue first.

Comment From: propellerjet

@sadpandajoe we are pulling this fix 31752 into 4.1.1

Comment From: rusackas

@propellerjet is this still an issue, or did the PR resolve the problem?