Can't make a timeserie if date is TIMESTAMP WITHOUT TIME ZONE (postgres)
See original GitHub issueMake sure these boxes are checked before submitting your issue - thank you!
- I have checked the superset logs for python stacktraces and included it here as text if any
- I have reproduced the issue with at least the latest released version of superset
- I have checked the issue tracker for the same issue and I haven’t found one similar
Superset version
0.28 RC6 from 2018-09-12
Expected results
A timeseris graph is displayed
Actual results
Unexepeted Error
is shown in the UI- Inspecting the asnwer from the corresponding https request, it shows a stacktrace finishing with :
File "/home/work/incubator-superset/superset/utils.py", line 366, in datetime_to_epoch return (dttm - epoch_with_tz).total_seconds() * 1000 File "pandas/_libs/tslibs/timestamps.pyx", line 320, in pandas._libs.tslibs.timestamps._Timestamp.__sub__ TypeError: Timestamp subtraction must have the same timezones or no timezones
Steps to reproduce
- Create source from a table having a date column of type
TIMESTAMP WITHOUT TIME ZONE
(postgres 9.3) - Try creating a timeseries graph using it
Workaround
- According to my colleagues (I could not test), the same database allowed making TS graphs with a version of superset he installed a month ago from an “image for easyer installation he found on github”
- Adding a record having value
my_date WITH TIME ZONE 'MST'
, typedTIMESTAMP
and using it as the time for the graph worked
Issue Analytics
- State:
- Created 5 years ago
- Reactions:7
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Can't make a timeserie if date is TIMESTAMP WITHOUT ...
Create source from a table having a date column of type TIMESTAMP WITHOUT TIME ZONE (postgres 9.3); Try creating a timeseries graph using...
Read more >What is a valid use case for using TIMESTAMP WITHOUT ...
It's valid to use timestamp and date for any timestamps and dates which are always in the same timezone, or are being stored...
Read more >Ignoring time zones altogether in Rails and PostgreSQL
I'm currently using 'timestamp without time zone' but when I retrieve the records, rails (?) converts them to the time zone in the...
Read more >BUG #15527: Issue converting from local date/time to ' ...
We have an application that is storing time series data in ... 'timestamp with time zone' field. ... I'm wondering if this is...
Read more >Using Postgres as a time series database
In practice when logging time series data, this is not usually a problem since each measurement device can neatly have its own column....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here is how I fixed this when running a clone of the repo’s master branch from 2018-11-01 and the Docker install (after few “adjustments” to make it work). I hope this will help others until it is permanently fixed…
For the “World’s Bank Data” dashboard:
I had another issue with the “World’s Bank Data” dashboard - some charts were erroring out with ‘column “xxxx” does not exist’. For example, ‘column “sp_pop_totl” does not exist’. To fix:
HTH
@davidgreenshtein - Sometimes you can work around it by creating a new calculated column and coercing to
::timestamptz
It doesn’t work if you just update the database expression though.