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 2020/01/13 14:20:33 UTC

[GitHub] [incubator-superset] lkuchars opened a new issue #8954: No numeric types to aggregate exception when using timeshift on line chart

lkuchars opened a new issue #8954: No numeric types to aggregate exception when using timeshift on line chart
URL: https://github.com/apache/incubator-superset/issues/8954
 
 
   This bug is easy to reproduce on vanilla superset with demo datasource and tables.
   What you do is you configure simplest **line chart** possible. The clue here is to turn on *timeshift* option for line chart. Time shift option should overlay another line (with historic data) on your current chart. Exception is always thrown when you setup filter for such chart so that query for historical results return no data at all.  
   
   To reproduce it make simple line chart on **random_time_series** table with **count()** metric and **month** time grain. Then setup time shift for **1 year** actual values. 
   When you setup filter so that only **recent** data is being presented all looks ok. But now try this.
   Earliest entry for **random_time_series** table is 2011-03-15. Setup your filter to **custom** timerange to show you data from 2011-01-01 to 2011-01-01. When you do that chart crashes. When you turn off **timeshift** option everything works as it should.
   
   The problem for us is that we're trying to setup superset for customer who has no historic data yet. But we want to preinstall dashboards that would use timeshift right away without waiting for current data to get old enough so that we can enable this on all line charts
   
   Is there any other way to configure (month back) timeshift on LineChart for dataset that has, let's say' only week worth of data and not crash superset?
   
   In case anyone having troubles how to reproduce I recorded screen capture:
   https://youtu.be/v1lXZAGLafM
   ### Expected results
   
   I'd expect LineChart to just ignore state were there is no data for timeshift. Only single plot would be displayed then
   
   
   ### Actual results
   
   This is stacktrace:
   ```
   superset2_1          | Traceback (most recent call last):
   superset2_1          |   File "/usr/local/lib/python3.6/site-packages/superset/views/base.py", line 120, in wraps
   superset2_1          |     return f(self, *args, **kwargs)
   superset2_1          |   File "/usr/local/lib/python3.6/site-packages/superset/utils/decorators.py", line 69, in wrapper
   superset2_1          |     return f(*args, **kwargs)
   superset2_1          |   File "/usr/local/lib/python3.6/site-packages/superset/views/core.py", line 1092, in explore_json
   superset2_1          |     viz_obj, csv=csv, query=query, results=results, samples=samples
   superset2_1          |   File "/usr/local/lib/python3.6/site-packages/superset/views/core.py", line 1013, in generate_json
   superset2_1          |     payload = viz_obj.get_payload()
   superset2_1          |   File "/usr/local/lib/python3.6/site-packages/superset/viz.py", line 373, in get_payload
   superset2_1          |     self.run_extra_queries()
   superset2_1          |   File "/usr/local/lib/python3.6/site-packages/superset/viz.py", line 1225, in run_extra_queries
   superset2_1          |     df2 = self.process_data(df2)
   superset2_1          |   File "/usr/local/lib/python3.6/site-packages/superset/viz.py", line 1160, in process_data
   superset2_1          |     index=DTTM_ALIAS, columns=fd.get("groupby"), values=self.metric_labels
   superset2_1          |   File "/usr/local/lib/python3.6/site-packages/pandas/core/frame.py", line 5759, in pivot_table
   superset2_1          |     margins_name=margins_name)
   superset2_1          |   File "/usr/local/lib/python3.6/site-packages/pandas/core/reshape/pivot.py", line 82, in pivot_table
   superset2_1          |     agged = grouped.agg(aggfunc)
   superset2_1          |   File "/usr/local/lib/python3.6/site-packages/pandas/core/groupby/generic.py", line 1315, in aggregate
   superset2_1          |     return super(DataFrameGroupBy, self).aggregate(arg, *args, **kwargs)
   superset2_1          |   File "/usr/local/lib/python3.6/site-packages/pandas/core/groupby/generic.py", line 186, in aggregate
   superset2_1          |     result, how = self._aggregate(arg, _level=_level, *args, **kwargs)
   superset2_1          |   File "/usr/local/lib/python3.6/site-packages/pandas/core/base.py", line 356, in _aggregate
   superset2_1          |     **kwargs), None
   superset2_1          |   File "/usr/local/lib/python3.6/site-packages/pandas/core/base.py", line 312, in _try_aggregate_string_function
   superset2_1          |     return f(*args, **kwargs)
   superset2_1          |   File "/usr/local/lib/python3.6/site-packages/pandas/core/groupby/groupby.py", line 1132, in mean
   superset2_1          |     return self._cython_agg_general('mean', **kwargs)
   superset2_1          |   File "/usr/local/lib/python3.6/site-packages/pandas/core/groupby/generic.py", line 70, in _cython_agg_general
   superset2_1          |     how, alt=alt, numeric_only=numeric_only, min_count=min_count)
   superset2_1          |   File "/usr/local/lib/python3.6/site-packages/pandas/core/groupby/generic.py", line 143, in _cython_agg_blocks
   superset2_1          |     raise DataError('No numeric types to aggregate')
   superset2_1          | pandas.core.base.DataError: No numeric types to aggregate
   ```
   #### Screenshots
   
   https://youtu.be/v1lXZAGLafM
   
   #### How to reproduce the bug
   
   Described in main section. 
   
   ### Environment
   
   Version: 0.35.1
   python
   ```
   superset@074734e962da:~$ python --version
   Python 3.6.9
   superset@074734e962da:~$ 
   
   ```
   Tested on superset running in docker:
   
   This is docker-compose.yml entry for it
   ```
     superset2:
       image: amancevice/superset:0.35.1
       ports:
         - "8888:8088"
   ```
   
   

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


[GitHub] [incubator-superset] stale[bot] closed issue #8954: No numeric types to aggregate exception when using timeshift on line chart

Posted by GitBox <gi...@apache.org>.
stale[bot] closed issue #8954: No numeric types to aggregate exception when using timeshift on line chart
URL: https://github.com/apache/incubator-superset/issues/8954
 
 
   

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


[GitHub] [incubator-superset] issue-label-bot[bot] commented on issue #8954: No numeric types to aggregate exception when using timeshift on line chart

Posted by GitBox <gi...@apache.org>.
issue-label-bot[bot] commented on issue #8954: No numeric types to aggregate exception when using timeshift on line chart
URL: https://github.com/apache/incubator-superset/issues/8954#issuecomment-573685379
 
 
   Issue-Label Bot is automatically applying the label `#bug` to this issue, with a confidence of 0.91. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback! 
   
    Links: [app homepage](https://github.com/marketplace/issue-label-bot), [dashboard](https://mlbot.net/data/apache/incubator-superset) and [code](https://github.com/hamelsmu/MLapp) for this bot.

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


[GitHub] [incubator-superset] stale[bot] commented on issue #8954: No numeric types to aggregate exception when using timeshift on line chart

Posted by GitBox <gi...@apache.org>.
stale[bot] commented on issue #8954: No numeric types to aggregate exception when using timeshift on line chart
URL: https://github.com/apache/incubator-superset/issues/8954#issuecomment-598748261
 
 
   This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue `.pinned` to prevent stale bot from closing the 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.
 
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