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 2021/08/27 19:24:53 UTC

[GitHub] [superset] kevin-struckhoff opened a new issue #16486: Unexpected Error Message at Chart Query runtime

kevin-struckhoff opened a new issue #16486:
URL: https://github.com/apache/superset/issues/16486


   Upon running the query for a newly built chart, an error message popped up saying 'Unexpected error' 'day_of_week'. Viewing the SQL for the query reveals a perfectly constructed SQL statement which runs just fine on my postgres db server. In the dataset for this table, the 'day_of_week' column is marked as 'is temporal' and it self-populated the time column box as expected. I also used the column 'day_of_week' as the 'sort by' column by adding it using 'custom sql'. The error is caused by the custom sql sort by setting. If I remove the  sort by the query runs but the data isn't sorted correctly. Sorting by non-metric columns is a must-have.
   
   I expected the query to run without error of course. In the attached screenshot, the query references the table calories_dow_agg which has 7 rows of data:
   
   create table calories_dow_agg (day_of_week char(8), avg_calories smallint);
   
    day_of_week | SUM(avg_calories)
   -------------+-------------------
     1 - Sun    |              1593
     2 - Mon    |              1618
     3 - Tue    |              1466
     4 - Wed    |              1431
     5 - Thu    |              1730
     6 - Fri    |              1559
     7 - Sat    |              1787
   (7 rows)
   
   #### How to reproduce the bug
   
   1. Create table and load data using the schema and data provided above.
   2. Add a new dataset for the table.
   3. Create a Bar chart and update the metric as 'SUM(avg_calories)', the series as 'day_of_week' and the sort by as 'day_of_week' in the custom sql tab.
   4. Press the Run button
   5. see the error
   
   ### Environment
   
   (please complete the following information):
   
   - superset version: `1.3.0`
   - python version: 3.8.6
   
   - any feature flags active: --with-threads --reload --debugger
   - 
   ![Unexpected-error](https://user-images.githubusercontent.com/88514509/131175919-02591217-869c-44b2-9781-d4e453fe64a9.png)
   


-- 
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] bkyryliuk commented on issue #16486: Unexpected Error Message at Chart Query runtime

Posted by GitBox <gi...@apache.org>.
bkyryliuk commented on issue #16486:
URL: https://github.com/apache/superset/issues/16486#issuecomment-990250970


   Couple more clarifications:
   it looks like sorting works for functions / metrics that return the number and fails for strings e.g.
   number:
   ![image](https://user-images.githubusercontent.com/5727938/145475299-d4a54dd0-5224-4024-8de2-5df13c070ec1.png)
   string:
   ![image](https://user-images.githubusercontent.com/5727938/145475355-dea69820-73c7-468d-b79f-ad6a9d6b6e79.png)
   


-- 
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] joyfullservice commented on issue #16486: Unexpected Error Message at Chart Query runtime

Posted by GitBox <gi...@apache.org>.
joyfullservice commented on issue #16486:
URL: https://github.com/apache/superset/issues/16486#issuecomment-1048292494


   Thanks for the tip on converting this value to a number! 👍 I was able to get this to work for a `date` field in my dataset (MySQL) by wrapping it in the `UNIX_TIMESTAMP()` function.
   
   ![image](https://user-images.githubusercontent.com/7254992/155233932-d05cacf7-6010-464f-8902-f5f54a847f2c.png)
   


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