You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by holdenk <gi...@git.apache.org> on 2018/08/03 16:48:19 UTC
[GitHub] spark pull request #20838: [SPARK-23698] Resolve undefined names in Python 3
Github user holdenk commented on a diff in the pull request:
https://github.com/apache/spark/pull/20838#discussion_r207604490
--- Diff: python/pyspark/streaming/tests.py ---
@@ -206,6 +207,22 @@ def func(dstream):
expected = [[len(x)] for x in input]
self._test_func(input, func, expected)
+ def test_slice(self):
+ """Basic operation test for DStream.slice."""
+ eol_python2 = dt.datetime(2020, 1, 1)
+ five_secs = dt.timedelta(seconds=5)
+ input = [eol_python2 - five_secs, eol_python2]
+
+ def func(dstream):
+ return dstream.slice()
+ expected = [dt.datetime(2019, 12, 31, 23, 55),
+ dt.datetime(2019, 12, 31, 23, 56),
+ dt.datetime(2019, 12, 31, 23, 57),
+ dt.datetime(2019, 12, 31, 23, 58),
+ dt.datetime(2019, 12, 31, 23, 59),
+ dt.datetime(2020, 1, 1)] # fat lady sings...
--- End diff --
please remove this comment.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org