GitHub user HyukjinKwon opened a pull request:
https://github.com/apache/spark/pull/18597
[SPARK-20456][PYTHON][FOLLOWUP] Fix timezone-dependent doctests in
unix_timestamp and from_unixtime
## What changes were proposed in this pull request?
This PR proposes to simply ignore the results in examples that are
timezone-dependent in `unix_timestamp` and `from_unixtime`.
```
Failed example:
time_df.select(unix_timestamp('dt',
'yyyy-MM-dd').alias('unix_time')).collect()
Expected:
[Row(unix_time=1428476400)]
Got:unix_timestamp
[Row(unix_time=1428418800)]
```
```
Failed example:
time_df.select(from_unixtime('unix_time').alias('ts')).collect()
Expected:
[Row(ts=u'2015-04-08 00:00:00')]
Got:
[Row(ts=u'2015-04-08 16:00:00')]
```
## How was this patch tested?
Manually tested and `./run-tests --modules pyspark-sql`.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/HyukjinKwon/spark SPARK-20456
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/18597.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #18597
----
commit 5c5f405af76df26d8387455867a270843ef216e2
Author: hyukjinkwon <[email protected]>
Date: 2017-07-11T03:56:02Z
Fix timezone-dependent doctests in unix_timestamp and from_unixtime
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]