Skip to content
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

Missing combination in data leads to odd sorting on Bar Chart v1 #21425

Open
3 tasks done
sfirke opened this issue Sep 9, 2022 · 5 comments
Open
3 tasks done

Missing combination in data leads to odd sorting on Bar Chart v1 #21425

sfirke opened this issue Sep 9, 2022 · 5 comments
Labels
#bug Bug report

Comments

@sfirke
Copy link
Contributor

sfirke commented Sep 9, 2022

When a dimension + x-value combo is absent from the data, the sorting malfunctions on bar chart v1. The x-value with the null dimension combination appears shifted left.

How to reproduce the bug

Create dashboard with a check-multiple filter and a bar chart v1 (because v2 is not yet custom sortable). Specify sorting for the x-axis variable using custom SQL like:

CASE
WHEN [Day of Week] = 'Sunday' THEN 1
WHEN [Day of Week] = 'Monday' THEN 2
...

There should be no records in the data for a specific combo of the filter variable and the x-axis variable. In this case, no Fatality has occurred on Thursday in the given time range.

Expected results

When I exclude the Fatality value on the filter, the Thursday x-axis value appears in the proper spot.

image

Actual results

When I include Fatality in the filter, Thursday appears following Tuesday. Note null in tooltip:
image

Environment

Superset 2.0.0.

GENERIC_CHART_AXES is active along with other flags.

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven't found one similar.
@sfirke sfirke added the #bug Bug report label Sep 9, 2022
@Shazad-khan
Copy link

In the latest version of Superset this issue has been fixed please recheck it and close if fixed.

@sfirke
Copy link
Contributor Author

sfirke commented Mar 20, 2023

Unfortunately that seems not to be the case. I just reproduced this bug on latest as of 5 minutes ago and I'm seeing the same error:

image

My workaround was to create a view of the data that populated zeroes into groups with no data.

@Shazad-khan
Copy link

can you make a small video of how you are trying to reproduce it for more clarification so that i can resolve this issue.

@rusackas
Copy link
Member

@sfirke is this still a problem?

@sfirke
Copy link
Contributor Author

sfirke commented Feb 23, 2024

I just replicated it in 3.1.1 😦
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug Bug report
Projects
None yet
Development

No branches or pull requests

3 participants