apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
62.44k stars 13.72k forks source link

Calendar Heatmap error in latest master #6278

Closed aboganas closed 5 years ago

aboganas commented 5 years ago

Make sure these boxes are checked before submitting your issue - thank you!

Superset version

Master

Expected results

Calendar Heatmap works

Actual results

I get the following error unsupported operand type(s) for /: 'Timestamp' and 'int'

Here is the Python

2018-11-06 05:56:26,419:ERROR:root:unsupported operand type(s) for /: 'Timestamp' and 'int'
Traceback (most recent call last):
  File "/Users/alganas/LEXER/master/incubator-superset/superset/views/core.py", line 1162, in generate_json
    payload = viz_obj.get_payload()
  File "/Users/alganas/LEXER/master/incubator-superset/superset/viz.py", line 372, in get_payload
    payload['data'] = self.get_data(df)
  File "/Users/alganas/LEXER/master/incubator-superset/superset/viz.py", line 788, in get_data
    for obj in records
  File "/Users/alganas/LEXER/master/incubator-superset/superset/viz.py", line 788, in <dictcomp>
    for obj in records
TypeError: unsupported operand type(s) for /: 'Timestamp' and 'int'

Steps to reproduce

just try to create a heatmap cal or load Calendar Heatmap multiformat example

apimastery commented 5 years ago

Not this should be something everyone does as a post-install step...I fixed it by reverting in my install the change to viz.py specified here: https://github.com/apache/incubator-superset/commit/7b3095d6ff0e0d40c52cb5f77937f5aae10da756#diff-f451672348fc6071e8d627778bdc4e96

aboganas commented 5 years ago

Thanks @apimastery this got it to work.

aboganas commented 5 years ago

@mistercrunch Should I send a pr for the fix that @apimastery or would It introduce other problems

aboganas commented 5 years ago

using dev installation now I get the following error

Uncaught TypeError: Cannot read property '0' of undefined
    at eval (Calendar.js?d33d:98)
    at Array.forEach (<anonymous>)
    at Calendar (Calendar.js?d33d:77)
    at ProxyComponent.execute (reactify.jsx?f3ca:28)
    at ProxyComponent.execute (react-hot-loader.development.js?c2cb:580)
    at ProxyComponent.componentDidMount (reactify.jsx?f3ca:11)
    at ProxyComponent.componentDidMount (react-hot-loader.development.js?c2cb:570)
    at commitLifeCycles (react-dom.development.js?61bb:14685)
    at commitAllLifeCycles (react-dom.development.js?61bb:15905)
    at HTMLUnknownElement.callCallback (react-dom.development.js?61bb:145)
(anonymous) @ Calendar.js?d33d:98
Calendar @ Calendar.js?d33d:77
execute @ reactify.jsx?f3ca:28
startTimer @ react-hot-loader.development.js?c2cb:580
componentDidMount @ reactify.jsx?f3ca:11
componentDidMount @ react-hot-loader.development.js?c2cb:570
commitLifeCycles @ react-dom.development.js?61bb:14685
commitAllLifeCycles @ react-dom.development.js?61bb:15905
callCallback @ react-dom.development.js?61bb:145
invokeGuardedCallbackDev @ react-dom.development.js?61bb:195
invokeGuardedCallback @ react-dom.development.js?61bb:248
commitRoot @ react-dom.development.js?61bb:16075
completeRoot @ react-dom.development.js?61bb:17463
performWorkOnRoot @ react-dom.development.js?61bb:17391
performWork @ react-dom.development.js?61bb:17295
performSyncWork @ react-dom.development.js?61bb:17267
requestWork @ react-dom.development.js?61bb:17155
scheduleWork @ react-dom.development.js?61bb:16949
enqueueSetState @ react-dom.development.js?61bb:11623
Component.setState @ react.development.js?72d0:413
update @ index.js?0a70:205
(anonymous) @ index.js?0a70:215
Promise.then (async)
_loadModule @ index.js?0a70:214
startTimer @ react-hot-loader.development.js?c2cb:580
componentWillMount @ index.js?0a70:168
callComponentWillMount @ react-dom.development.js?61bb:11829
mountClassInstance @ react-dom.development.js?61bb:11917
updateClassComponent @ react-dom.development.js?61bb:13492
beginWork @ react-dom.development.js?61bb:14090
performUnitOfWork @ react-dom.development.js?61bb:16416
workLoop @ react-dom.development.js?61bb:16454
renderRoot @ react-dom.development.js?61bb:16533
performWorkOnRoot @ react-dom.development.js?61bb:17387
performWork @ react-dom.development.js?61bb:17295
performSyncWork @ react-dom.development.js?61bb:17267
requestWork @ react-dom.development.js?61bb:17155
scheduleWork @ react-dom.development.js?61bb:16949
enqueueSetState @ react-dom.development.js?61bb:11623
Component.setState @ react.development.js?72d0:413
onStateChange @ connectAdvanced.js?fe33:205
startTimer @ react-hot-loader.development.js?c2cb:580
dispatch @ createStore.js?61ed:173
(anonymous) @ index.js?b083:11
dispatch @ applyMiddleware.js?05f2:35
(anonymous) @ chartAction.js?2410:173
Promise.then (async)
(anonymous) @ chartAction.js?2410:155
(anonymous) @ index.js?b083:8
(anonymous) @ bindActionCreators.js?f901:3
componentDidMount @ Chart.jsx?70bb:63
componentDidMount @ react-hot-loader.development.js?c2cb:570
commitLifeCycles @ react-dom.development.js?61bb:14685
commitAllLifeCycles @ react-dom.development.js?61bb:15905
callCallback @ react-dom.development.js?61bb:145
invokeGuardedCallbackDev @ react-dom.development.js?61bb:195
invokeGuardedCallback @ react-dom.development.js?61bb:248
commitRoot @ react-dom.development.js?61bb:16075
completeRoot @ react-dom.development.js?61bb:17463
performWorkOnRoot @ react-dom.development.js?61bb:17391
performWork @ react-dom.development.js?61bb:17295
performSyncWork @ react-dom.development.js?61bb:17267
requestWork @ react-dom.development.js?61bb:17155
scheduleWork @ react-dom.development.js?61bb:16949
enqueueSetState @ react-dom.development.js?61bb:11623
Component.setState @ react.development.js?72d0:413
resize @ vx-responsive.es.js?d25d:653
startTimer @ react-hot-loader.development.js?c2cb:580
invokeFunc @ vx-responsive.es.js?d25d:415
trailingEdge @ vx-responsive.es.js?d25d:464
timerExpired @ vx-responsive.es.js?d25d:452
setTimeout (async)
leadingEdge @ vx-responsive.es.js?d25d:423
debounced @ vx-responsive.es.js?d25d:492
(anonymous) @ vx-responsive.es.js?d25d:603
requestAnimationFrame (async)
_loop @ vx-responsive.es.js?d25d:602
(anonymous) @ vx-responsive.es.js?d25d:620
react-dom.development.js?61bb:14550 The above error occurred in the <Calendar> component:
    in Calendar (created by LoadableComponent)
    in LoadableComponent (created by SuperChart)
    in div (created by SuperChart)
    in SuperChart (created by Chart)
    in div (created by Chart)
    in ErrorBoundary (created by Chart)
    in Chart (created by Connect(Chart))
    in Connect(Chart) (created by ParentSize)
    in div (created by ParentSize)
    in ParentSize (created by ExploreChartPanel)
    in div (created by Panel)
    in div (created by Panel)
    in Panel (created by ExploreChartPanel)
    in div (created by ExploreChartPanel)
    in ExploreChartPanel (created by ExploreViewContainer)
    in div (created by ExploreViewContainer)
    in div (created by ExploreViewContainer)
    in div (created by ExploreViewContainer)
    in ExploreViewContainer (created by Connect(ExploreViewContainer))
    in Connect(ExploreViewContainer) (created by App)
    in div (created by App)
    in Provider (created by App)
    in App (created by HotExportedApp)
    in AppContainer (created by HotExportedApp)
    in HotExportedApp