Repository: spark
Updated Branches:
  refs/heads/master 3d0cccc85 -> 6b18cdc1b


[SPARK-7711] Add a startTime property to match the corresponding one in Scala

Author: Holden Karau <[email protected]>

Closes #6275 from holdenk/SPARK-771-startTime-is-missing-from-pyspark and 
squashes the following commits:

06662dc [Holden Karau] add mising blank line for style checks
7a87410 [Holden Karau] add back missing newline
7a7876b [Holden Karau] Add a startTime property to match the corresponding one 
in the Scala SparkContext


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/6b18cdc1
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/6b18cdc1
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/6b18cdc1

Branch: refs/heads/master
Commit: 6b18cdc1b1284b1d48d637d06a1e64829aeb6202
Parents: 3d0cccc
Author: Holden Karau <[email protected]>
Authored: Thu May 21 14:08:57 2015 -0700
Committer: Josh Rosen <[email protected]>
Committed: Thu May 21 14:08:57 2015 -0700

----------------------------------------------------------------------
 python/pyspark/context.py | 5 +++++
 python/pyspark/tests.py   | 4 ++++
 2 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/6b18cdc1/python/pyspark/context.py
----------------------------------------------------------------------
diff --git a/python/pyspark/context.py b/python/pyspark/context.py
index 1f2b40b..aeb7ad4 100644
--- a/python/pyspark/context.py
+++ b/python/pyspark/context.py
@@ -292,6 +292,11 @@ class SparkContext(object):
         return self._jsc.version()
 
     @property
+    def startTime(self):
+        """Return the epoch time when the Spark Context was started."""
+        return self._jsc.startTime()
+
+    @property
     def defaultParallelism(self):
         """
         Default level of parallelism to use when not given by user (e.g. for

http://git-wip-us.apache.org/repos/asf/spark/blob/6b18cdc1/python/pyspark/tests.py
----------------------------------------------------------------------
diff --git a/python/pyspark/tests.py b/python/pyspark/tests.py
index d8e3199..f9fb37f 100644
--- a/python/pyspark/tests.py
+++ b/python/pyspark/tests.py
@@ -1809,6 +1809,10 @@ class ContextTests(unittest.TestCase):
 
             sc.stop()
 
+    def test_startTime(self):
+        with SparkContext() as sc:
+            self.assertGreater(sc.startTime, 0)
+
 
 @unittest.skipIf(not _have_scipy, "SciPy not installed")
 class SciPyTests(PySparkTestCase):


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to