lexrf commented on issue #4356: Timestamp from Kylin become 1970/01/01...
URL: 
https://github.com/apache/incubator-superset/issues/4356#issuecomment-363760133
 
 
   I debugged the code and found the problem happens in viz.py 114-122
   
               if DTTM_ALIAS in df.columns:
                   if timestamp_format in ('epoch_s', 'epoch_ms'):
                       df[DTTM_ALIAS] = pd.to_datetime(df[DTTM_ALIAS], 
utc=False)
                   else:
                       df[DTTM_ALIAS] = pd.to_datetime(
                           df[DTTM_ALIAS], utc=False, format=timestamp_format)
                   if self.datasource.offset:
                       df[DTTM_ALIAS] += timedelta(hours=self.datasource.offset)
   
   it use pandas.to_datetime to convert the timestamp value to datetime format. 
However, by default the to_datetime function us ns as original time unit. And 
the query result is in second. This make time value * 10e-9 after convert.
   
   Surperset should use some code to determine the timestamp unit.
   
   

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to