superset icon indicating copy to clipboard operation
superset copied to clipboard

Timestamped data with PostgreSQL backend

Open guinny65 opened this issue 8 years ago • 1 comments

Make sure these boxes are checked 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.

Superset version

0.28.1

Expected results

When using timestamped data from a PostgreSQL database, time series graphs are not working. Error found in logs is:

File "/usr/local/lib/python3.6/site-packages/superset/utils.py", line 360, in datetime_to_epoch                                                                                                                                  superset_server |     return (dttm - epoch_with_tz).total_seconds() * 1000
superset_server |   File "pandas/_libs/tslibs/timestamps.pyx", line 311, in pandas._libs.tslibs.timestamps._Timestamp.__sub__                                                                                                                                        
superset_server | TypeError: Timestamp subtraction must have the same timezones or no timezones

This is fixed by setting utc=True in viz.py:

sed -i -e 's/utc=False/utc=True/g' /usr/local/lib/python3.5/dist-packages/superset/viz.py

Could not this be set as a default ?

guinny65 avatar Nov 06 '18 09:11 guinny65

This issue sounds related to another Postgres-like DB issue:

https://github.com/apache/incubator-superset/issues/5910

kingo55 avatar Nov 06 '18 11:11 kingo55