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 2019/01/26 16:51:12 UTC
[GitHub] kdorsel commented on issue #6763: postgres timestamp when using
Include Time in table view
kdorsel commented on issue #6763: postgres timestamp when using Include Time in table view
URL: https://github.com/apache/incubator-superset/issues/6763#issuecomment-457846237
I got the latest commit (a62a8d3d985ed7343fe83540e5cdcbb1474ac6ac) and tried again.
It seems to have fixed the issue with columns of `timestamp with time zone`, but still getting errors with columns without time zones.
```
019-01-26 11:35:41,157:INFO:root:Database.get_sqla_engine(). Masked URL: postgresql+psycopg2://kaass:XXXXXXXXXX@localhost:5432/postgres
2019-01-26 11:35:41,158:INFO:root:SELECT DATE_TRUNC('day', day) AT TIME ZONE 'UTC' AS __timestamp, AVG(value) AS "AVG(value)"
FROM shop GROUP BY DATE_TRUNC('day', day) AT TIME ZONE 'UTC' ORDER BY "AVG(value)" DESC
LIMIT 10000
2019-01-26 11:35:41,166:INFO:root:Database.get_sqla_engine(). Masked URL: postgresql+psycopg2://kaass:XXXXXXXXXX@localhost:5432/postgres
2019-01-26 11:35:41,185:ERROR:root:Tz-aware datetime.datetime cannot be converted to datetime64 unless utc=True
Traceback (most recent call last):
File "/Users/kaass/.envs/superset-head-env/lib/python3.7/site-packages/pandas/core/tools/datetimes.py", line 377, in _convert_listlike
values, tz = conversion.datetime_to_datetime64(arg)
File "pandas/_libs/tslibs/conversion.pyx", line 174, in pandas._libs.tslibs.conversion.datetime_to_datetime64
ValueError: Array must be all same time zone
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/kaass/.envs/incubator-superset/superset/viz.py", line 410, in get_df_payload
df = self.get_df(query_obj)
File "/Users/kaass/.envs/incubator-superset/superset/viz.py", line 231, in get_df
df[DTTM_ALIAS], utc=False, format=timestamp_format)
File "/Users/kaass/.envs/superset-head-env/lib/python3.7/site-packages/pandas/core/tools/datetimes.py", line 451, in to_datetime
values = _convert_listlike(arg._values, True, format)
File "/Users/kaass/.envs/superset-head-env/lib/python3.7/site-packages/pandas/core/tools/datetimes.py", line 380, in _convert_listlike
raise e
File "/Users/kaass/.envs/superset-head-env/lib/python3.7/site-packages/pandas/core/tools/datetimes.py", line 368, in _convert_listlike
require_iso8601=require_iso8601
File "pandas/_libs/tslib.pyx", line 492, in pandas._libs.tslib.array_to_datetime
File "pandas/_libs/tslib.pyx", line 537, in pandas._libs.tslib.array_to_datetime
ValueError: Tz-aware datetime.datetime cannot be converted to datetime64 unless utc=True
```
----------------------------------------------------------------
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