-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Heatmap y-axis sorting logic broken #31318
Comments
@nicholaslimck Hello! I'm here to help you with your Superset issue. I can assist with bug fixes, answer your questions, and guide you on becoming a contributor. Let's work together to resolve the problem you're experiencing. The Y-axis sorting logic in the Echarts-based Heatmap chart in Superset 4.1.1 is controlled by the For If the sorting does not appear to be working as expected, especially with mixed data types (strings and numbers), it might be due to how the sorting logic handles these types. The current implementation may not correctly handle mixed data types, leading to unexpected sorting behavior. This could be a point of investigation or improvement in the codebase. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
@dosu I don't think the Echarts-based Heatmap uses the same sorting logic as the legacy Heatmap chart. Is the sorting logic inherited from the Echarts project or is it defined within Superset? |
The sorting logic for the Y-axis in the Echarts-based Heatmap chart is defined within Superset, not inherited from the Echarts project. The To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
@dosu The sorting logic seems to only consider the query results. Given the following data:
The resultant Heatmap looks like this: The Y axis is sorted by the value in the 'machine' column, but the sorting is dependent on the timestamp order instead of purely in alphabetical order. This results in a staggered sort effect, where the 'machine' values are sorted on the Y axis based on:
However, I want to sort the Y axis only on the alphabetical order of the 'machine' column. |
To sort the Y-axis of the Heatmap chart in Superset based solely on the alphabetical order of the 'machine' column, you should set the To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
@michael-s-molina I noticed that the legacy Heatmap chart is scheduled for removal in Superset 5.0. Probably a good idea to make sure that feature parity is maintained since the legacy Heatmap's sorting logic was fixed. I couldn't figure out if there was any other sorting logic applied outside of the query so hopefully someone more familiar with the implementation could take a look. |
Hi @nicholaslimck. I was able to reproduce the problem and I'll submit a fix before 5.0. Thank you for the issue and for adding a dataset example. |
Bug description
Observed on Superset 4.1.1, deployed on Kubernetes using the Helm chart.
The Echarts-based Heatmap chart seems to sort the Y-axis through some unknown logic.
A similar issue was raised for the legacy Heatmap chart at #27357 and was fixed in PR #27360. The legacy Heatmap was sorting numeric values as strings, but this behaviour seems to be a bit different. Regardless of whether there is a string or numeric value on the Y-axis, sorting does not seem to make sense as it does not seem to be in alphabetical or numeric order.
X-axis sorting seems to work with my timestamp column both in ascending and descending order.
Screenshots/recordings
With Y-axis sorted by 'Axis ascending':
Superset version
4.1.1
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist
The text was updated successfully, but these errors were encountered: