You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Anton Daitche (JIRA)" <ji...@apache.org> on 2018/08/16 09:09:00 UTC
[jira] [Updated] (SPARK-25130) [Python] Wrong timestamp returned by
toPandas
[ https://issues.apache.org/jira/browse/SPARK-25130?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Anton Daitche updated SPARK-25130:
----------------------------------
Summary: [Python] Wrong timestamp returned by toPandas (was: Wrong timestamp returned by toPandas)
> [Python] Wrong timestamp returned by toPandas
> ---------------------------------------------
>
> Key: SPARK-25130
> URL: https://issues.apache.org/jira/browse/SPARK-25130
> Project: Spark
> Issue Type: Bug
> Components: Input/Output
> Affects Versions: 2.3.0, 2.3.1
> Environment: Tested with version 2.3.1 on OSX and 2.3.0 on Linux.
> Reporter: Anton Daitche
> Priority: Major
>
> The code snippet
> {code:java}
> import datetime
> df = spark.createDataFrame([(datetime.datetime(1901, 1, 1, 0, 0, 0),)], ["ts"])
> print("collect:", df.collect()[0][0])
> print("toPandas:", df.toPandas().iloc[0, 0])
> {code}
> prints
> {code:java}
> collect: 1901-01-01 00:00:00
> toPandas: 1900-12-31 23:53:00{code}
> Hence the toPandas methods seems to convert the timestamp wrongly.
> The problem disappears for "1902-01-01 00:00:00" and later dates (I didn't do an exhaustive test though).
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org