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 2018/09/06 02:12:52 UTC

[GitHub] minh5 commented on issue #5827: Add missing label quotes to sqla queries

minh5 commented on issue #5827: Add missing label quotes to sqla queries
URL: https://github.com/apache/incubator-superset/pull/5827#issuecomment-418940856
 
 
   Hey @villebro I'm trying to run some tests and ran into some weird issues on Redshift. It's the same error I've been running into with Redshift aggregations.
   
   ```
   2018-09-05 22:01:49,675:INFO:root:Database.get_sqla_engine(). Masked URL: redshift+psycopg2://cavagrill:XXXXXXXXXX@redshift.amazonaws.com:5439/testdb
   2018-09-05 22:01:49,681:INFO:root:SELECT day AS __timestamp, COUNT(*) AS count
   FROM test.sales_table
   WHERE day >= '2018-08-29 00:00:00' AND day <= '2018-09-05 22:01:49' GROUP BY day ORDER BY count DESC
    LIMIT 10000
   2018-09-05 22:01:49,692:INFO:root:Database.get_sqla_engine(). Masked URL: redshift+psycopg2://cavagrill:XXXXXXXXXX@redshift.amazonaws.com:5439/testdb
   2018-09-05 22:01:51,754:DEBUG:root:[stats_logger] (incr) loaded_from_source
   2018-09-05 22:01:51,791:INFO:werkzeug:127.0.0.1 - - [05/Sep/2018 22:01:51] "POST /superset/explore_json/ HTTP/1.1" 200 -
   2018-09-05 22:01:51,826:DEBUG:root:[stats_logger] (incr) log
   2018-09-05 22:01:51,829:INFO:werkzeug:127.0.0.1 - - [05/Sep/2018 22:01:51] "POST /superset/log/?slice_id=0 HTTP/1.1" 200 -
   2018-09-05 22:02:02,313:DEBUG:root:[stats_logger] (incr) explore_json
   2018-09-05 22:02:02,402:INFO:root:Cache key: a1a934775176c2934b028cad8f959e86
   2018-09-05 22:02:02,404:INFO:root:Database.get_sqla_engine(). Masked URL: redshift+psycopg2://cavagrill:XXXXXXXXXX@redshift.amazonaws.com:5439/testdb
   2018-09-05 22:02:02,413:INFO:root:SELECT day AS __timestamp, SUM(itemsales) AS "SUM(itemsales)"
   FROM test.sales_table
   WHERE day >= '2018-08-29 00:00:00' AND day <= '2018-09-05 22:02:02' GROUP BY day ORDER BY "SUM(itemsales)" DESC
    LIMIT 10000
   2018-09-05 22:02:02,425:INFO:root:Database.get_sqla_engine(). Masked URL: redshift+psycopg2://cavagrill:XXXXXXXXXX@redshift.amazonaws.com:5439/testdb
   2018-09-05 22:02:04,715:DEBUG:root:[stats_logger] (incr) loaded_from_source
   2018-09-05 22:02:04,716:ERROR:root:'SUM(itemsales)'
   Traceback (most recent call last):
     File "/Users/minhmai/.pyenv/versions/3.4.3/envs/superset/lib/python3.4/site-packages/superset/views/core.py", line 1105, in generate_json
       payload = viz_obj.get_payload()
     File "/Users/minhmai/.pyenv/versions/3.4.3/envs/superset/lib/python3.4/site-packages/superset/viz.py", line 359, in get_payload
       payload['data'] = self.get_data(df)
     File "/Users/minhmai/.pyenv/versions/3.4.3/envs/superset/lib/python3.4/site-packages/superset/viz.py", line 1243, in get_data
       df = self.process_data(df)
     File "/Users/minhmai/.pyenv/versions/3.4.3/envs/superset/lib/python3.4/site-packages/superset/viz.py", line 1147, in process_data
       values=utils.get_metric_names(fd.get('metrics')))
     File "/Users/minhmai/.pyenv/versions/3.4.3/envs/superset/lib/python3.4/site-packages/pandas/core/frame.py", line 5303, in pivot_table
       margins_name=margins_name)
     File "/Users/minhmai/.pyenv/versions/3.4.3/envs/superset/lib/python3.4/site-packages/pandas/core/reshape/pivot.py", line 61, in pivot_table
       raise KeyError(i)
   KeyError: 'SUM(itemsales)'
   ```
   
   Also here's a screen shot
   
   ![image](https://user-images.githubusercontent.com/7282400/45130872-8c119100-b158-11e8-9f28-f24ba45a111c.png)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org