You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "propellerjet (via GitHub)" <gi...@apache.org> on 2025/03/11 11:49:28 UTC
[I] Echarts Heatmap y-axis sorting logic is not correct when there are empty cells [superset]
propellerjet opened a new issue, #32591:
URL: https://github.com/apache/superset/issues/32591
### Bug description
[nicholaslimck](https://github.com/nicholaslimck) have already mentioned in [31318](https://github.com/apache/superset/issues/31318) about the problem with y axis sorting in echarts heatmap, but the issue was closed and fix [31752](https://github.com/apache/superset/pull/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.

3. Result

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

### Superset version
4.1.1
### Python version
3.9
### Node version
16
### Browser
Chrome
### Additional context
Legacy heatmap sorting works correctly

### 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.
--
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-unsubscribe@superset.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Echarts Heatmap y-axis sorting logic is not correct when there are empty cells [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #32591:
URL: https://github.com/apache/superset/issues/32591#issuecomment-2959597991
@propellerjet is this still an issue, or did the PR resolve the problem?
--
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-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Echarts Heatmap y-axis sorting logic is not correct when there are empty cells [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #32591:
URL: https://github.com/apache/superset/issues/32591#issuecomment-2713873113
<!-- Answer -->
A similar issue was previously reported in [issue #31318](https://github.com/apache/superset/issues/31318), which was closed after a fix was implemented in [pull request #31752](https://github.com/apache/superset/pull/31752). However, it seems that the fix did not resolve the problem for cases with empty cells in the heatmap <sup>[[1]](https://github.com/apache/superset/issues/31318)</sup>.
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 <sup>[[2]](https://github.com/apache/superset/blob/master/superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/controlPanel.tsx)</sup>.
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 <sup>[[3]](https://github.com/apache/superset/blob/master/superset-frontend/plugins/plugin-chart-echarts/test/utils/series.test.ts)</sup>.
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 <sup>[[4]](https://github.com/apache/superset/blob/master/RELEASING/release-notes-4-1/README.md)</sup>.
<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
---
<sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/129749f2-02b4-4fd7-a236-b14d32ee2d70?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/129749f2-02b4-4fd7-a236-b14d32ee2d70?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/129749f2-02b4-4fd7-a236-b14d32ee2d70?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/129749f2-02b4-4fd7-a236-b14d32ee2d70?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/129749f2-02b4-4fd7-a236-b14d32ee2d70?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/129749f2-02b4-4fd7-a236-b14d32ee2d70?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/129749f2-02b4-4fd7-a236-b14d32ee2d70?feedback_type=other)</sup>
--
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-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Echarts Heatmap y-axis sorting logic is not correct when there are empty cells [superset]
Posted by "propellerjet (via GitHub)" <gi...@apache.org>.
propellerjet commented on issue #32591:
URL: https://github.com/apache/superset/issues/32591#issuecomment-2715165926
@sadpandajoe we are pulling this fix [31752](https://github.com/apache/superset/pull/31752) into 4.1.1
--
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-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Echarts Heatmap y-axis sorting logic is not correct when there are empty cells [superset]
Posted by "sfirke (via GitHub)" <gi...@apache.org>.
sfirke commented on issue #32591:
URL: https://github.com/apache/superset/issues/32591#issuecomment-3922232043
I think I fixed this with https://github.com/apache/superset/pull/36302 which is present in 6.0.1rc1. I am going to close this, but if anyone can verify that this behavior persists on `master` branch or in any release 6.0.1+ please post more details and we can re-open.
--
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-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Echarts Heatmap y-axis sorting logic is not correct when there are empty cells [superset]
Posted by "andredionildo (via GitHub)" <gi...@apache.org>.
andredionildo commented on issue #32591:
URL: https://github.com/apache/superset/issues/32591#issuecomment-3707352205
### Bug: ECharts Heatmap Y-axis category order changes after filtering (weekdays become reordered)
**Superset version:** 6.0.0
**DB:** Postgres
**Chart:** ECharts Heatmap
**Timezone used in query:** Europe/Lisbon
This behavior appears to be already reported in issues [#32591](https://github.com/apache/superset/issues/32591), [#33245](https://github.com/apache/superset/issues/33245) and [#31318](https://github.com/apache/superset/issues/31318); however, the problem is still present in Superset 6.0.0, as the Y-axis category order continues to change when applying filters or short time ranges.
#### Summary
When I apply filters (e.g. filtering to a single user, or changing the time range to “Last week/Last month”), the **Y-axis category order changes** in the ECharts Heatmap.
Even with **Y-axis sorting configured as Ascending**, the Y-axis is no longer stable (e.g. weekday labels no longer stay Monday → Sunday).
This is especially noticeable when the filtered dataset becomes **sparse** (some weekday/hour combinations are missing), at which point the Y-axis order appears to be derived from result ordering / first-seen values rather than the configured sort.
#### Steps to reproduce
1. Create an **ECharts Heatmap** with:
- X axis: `hour_of_day` (0–23)
- Y axis: `day_of_week_label` (string)
- Metric: `COUNT(*)`
2. Configure sorting:
- X-axis sort = Ascending
- Y-axis sort = Ascending
3. Use weekday labels that are explicitly sortable (numeric prefix), e.g.:
- `01 - Monday`, `02 - Tuesday`, …, `07 - Sunday`
4. Apply a filter that removes many rows (e.g. filter to a single user, or set a short time range like last 7 days) so that some weekday/hour combinations become missing.
5. Observe that the Y-axis weekday order changes.
#### Expected behavior
The Y-axis categories should remain **stable and correctly ordered** (e.g. `01 - Monday` → `07 - Sunday`) regardless of filters / time range, as long as Y-axis sort is set to Ascending.
#### Actual behavior
After applying filters / changing time range, the Y-axis weekday categories become reordered (order changes depending on the filtered result set), even though Y-axis sorting is set to Ascending.
#### Minimal SQL example (sanitized)
```sql
SELECT
CAST(EXTRACT(HOUR FROM ts AT TIME ZONE 'Europe/Lisbon') AS INT) AS hour_of_day,
LPAD(CAST(EXTRACT(ISODOW FROM ts AT TIME ZONE 'Europe/Lisbon') AS TEXT), 2, '0')
|| ' - ' ||
CASE EXTRACT(ISODOW FROM ts AT TIME ZONE 'Europe/Lisbon')
WHEN 1 THEN 'Monday'
WHEN 2 THEN 'Tuesday'
WHEN 3 THEN 'Wednesday'
WHEN 4 THEN 'Thursday'
WHEN 5 THEN 'Friday'
WHEN 6 THEN 'Saturday'
WHEN 7 THEN 'Sunday'
END AS day_of_week_label,
COUNT(*) AS cnt
FROM some_table
WHERE
role = 'assistant'
AND user_id = '<single_user_filter>' -- makes data sparse
AND ts >= NOW() - INTERVAL '7 days' -- example timeframe filter
GROUP BY 1,2
ORDER BY hour_of_day ASC, day_of_week_label ASC;
--
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-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Echarts Heatmap y-axis sorting logic is not correct when there are empty cells [superset]
Posted by "sfirke (via GitHub)" <gi...@apache.org>.
sfirke closed issue #32591: Echarts Heatmap y-axis sorting logic is not correct when there are empty cells
URL: https://github.com/apache/superset/issues/32591
--
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-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] Echarts Heatmap y-axis sorting logic is not correct when there are empty cells [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on issue #32591:
URL: https://github.com/apache/superset/issues/32591#issuecomment-2715110560
@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.
--
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-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org