You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/09/09 18:31:52 UTC

[GitHub] [superset] sfirke opened a new issue, #21425: Missing combination in data leads to odd sorting on Bar Chart v1

sfirke opened a new issue, #21425:
URL: https://github.com/apache/superset/issues/21425

   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](https://user-images.githubusercontent.com/7569808/189418571-88c90d29-378d-4da3-9af7-6e672d541bf8.png)
   
   ### Actual results
   
   When I include Fatality in the filter, Thursday appears following Tuesday.  Note *null* in tooltip:
   ![image](https://user-images.githubusercontent.com/7569808/189418265-3a87443f-8e46-4868-a076-941c78c41d16.png)
   
   ### 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!
   
   - [x] I have checked the superset logs for python stacktraces and included it here as text if there are any.
   - [x] I have reproduced the issue with at least the latest released version of superset.
   - [x] I have checked the issue tracker for the same issue and I haven't found one similar.


-- 
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] Missing combination in data leads to odd sorting on Bar Chart v1 [superset]

Posted by "marianysilva (via GitHub)" <gi...@apache.org>.
marianysilva commented on issue #21425:
URL: https://github.com/apache/superset/issues/21425#issuecomment-2403128905

   We applied a small workaround here by adding invisible characters to the names of the days of the week to get the correct sorting. By using this field on the x-axis, you can sort properly. 
   
   ```
   DECODE(
     EXTRACT(DAYOFWEEK FROM OPERATIONAL_DATE_LTZ),
     1, '\uFE01Sunday',
     2, '\uFE02Monday',
     3, '\uFE03Tuesday',
     4, '\uFE04Wednesday',
     5, '\uFE05Thursday',
     6, '\uFE06Friday',
     7, '\uFE07Saturday'
   )
   ```
   
   This also works for sorting metrics. You just need to add the invisible character to the metric name in the YAML file.
   
   ```
   - metric_name: work
     verbose_name: "\uFE03Work"
   ```
   
   ```
   - metric_name: schedule
     verbose_name: "\uFE03schedule"
   ```
   
   ```
   - metric_name: unfilled
     verbose_name: "\uFE03Unfilled"
   ```
   ![Screenshot 2024-10-09 at 15 49 56](https://github.com/user-attachments/assets/86b1ca93-5f80-4f79-97d7-ebeb609eb700)
   ![Screenshot 2024-10-09 at 15 45 47](https://github.com/user-attachments/assets/de17b670-3a08-46d5-b2ef-8ce547194b34)
   ![Screenshot 2024-10-09 at 15 41 33](https://github.com/user-attachments/assets/15b29123-bc60-4732-98eb-f3446e54863b)
   


-- 
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


[GitHub] [superset] Shazad-khan commented on issue #21425: Missing combination in data leads to odd sorting on Bar Chart v1

Posted by "Shazad-khan (via GitHub)" <gi...@apache.org>.
Shazad-khan commented on issue #21425:
URL: https://github.com/apache/superset/issues/21425#issuecomment-1477368415

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


-- 
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] Missing combination in data leads to odd sorting on Bar Chart v1 [superset]

Posted by "sfirke (via GitHub)" <gi...@apache.org>.
sfirke commented on issue #21425:
URL: https://github.com/apache/superset/issues/21425#issuecomment-1962035937

   I just replicated it in 3.1.1 😦 
   ![image](https://github.com/apache/superset/assets/7569808/ca352867-fad0-42b6-b169-115ec8a38645)
   


-- 
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


[GitHub] [superset] Shazad-khan commented on issue #21425: Missing combination in data leads to odd sorting on Bar Chart v1

Posted by "Shazad-khan (via GitHub)" <gi...@apache.org>.
Shazad-khan commented on issue #21425:
URL: https://github.com/apache/superset/issues/21425#issuecomment-1475834109

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


-- 
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] Missing combination in data leads to odd sorting on Bar Chart v1 [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #21425:
URL: https://github.com/apache/superset/issues/21425#issuecomment-2218688256

   This just hit my little "stale issues" review cycle, but it still seems pertinent, so we'll keep it open. Not sure if @villebro saw this one, as the go-to X Axis guru.


-- 
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] Missing combination in data leads to odd sorting on Bar Chart v1 [superset]

Posted by "sfirke (via GitHub)" <gi...@apache.org>.
sfirke commented on issue #21425:
URL: https://github.com/apache/superset/issues/21425#issuecomment-2405168584

   I just confirmed this issue persists on 4.1.0rc2.  I am going to close it, though, since it's a niche problem that I still don't understand and it is affecting a legacy chart that we will (I think?) eventually migrate away from.  So IMO it's not a bug that should get attention.
   
   I _am_ going to open a new discussion, though, because I don't think the Bar Chart (v2) chart type accommodates ordering categorical x-axis variables by another arbitrary variable.  For instance in the case here of wanting to sort the days of the week, or if you wanted to sort months of the year in order instead of alphabetically.  To me that's a gap in Superset's functionality, with the fix being to allow "x-axis sort by" to use another variable.  In the meantime, it'll be a place for users to discuss workarounds - like what @marianysilva shared - until it's addressed.


-- 
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] Missing combination in data leads to odd sorting on Bar Chart v1 [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #21425:
URL: https://github.com/apache/superset/issues/21425#issuecomment-1961927288

   @sfirke is this still a 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] Missing combination in data leads to odd sorting on Bar Chart v1 [superset]

Posted by "sfirke (via GitHub)" <gi...@apache.org>.
sfirke closed issue #21425: Missing combination in data leads to odd sorting on Bar Chart v1
URL: https://github.com/apache/superset/issues/21425


-- 
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


[GitHub] [superset] sfirke commented on issue #21425: Missing combination in data leads to odd sorting on Bar Chart v1

Posted by "sfirke (via GitHub)" <gi...@apache.org>.
sfirke commented on issue #21425:
URL: https://github.com/apache/superset/issues/21425#issuecomment-1476660785

   Unfortunately that seems not to be the case.  I just reproduced this bug on [`latest` as of 5 minutes ago](https://hub.docker.com/layers/apache/superset/latest/images/sha256-120cd4a20b1ceefd8aa3b347fc80319f8b2d01bc8feb5867b7e3b0a83b820e3f) and I'm seeing the same error:
   
   ![image](https://user-images.githubusercontent.com/7569808/226421538-ca26c6b1-c806-40ad-befd-71b6af36d200.png)
   
   My workaround was to create a view of the data that populated zeroes into groups with no data.


-- 
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