Return-Path: X-Original-To: apmail-spark-commits-archive@minotaur.apache.org Delivered-To: apmail-spark-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 550C618885 for ; Thu, 21 May 2015 21:09:15 +0000 (UTC) Received: (qmail 35546 invoked by uid 500); 21 May 2015 21:09:15 -0000 Delivered-To: apmail-spark-commits-archive@spark.apache.org Received: (qmail 35516 invoked by uid 500); 21 May 2015 21:09:15 -0000 Mailing-List: contact commits-help@spark.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@spark.apache.org Received: (qmail 35507 invoked by uid 99); 21 May 2015 21:09:15 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 May 2015 21:09:15 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 206A2E51B1; Thu, 21 May 2015 21:09:15 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: joshrosen@apache.org To: commits@spark.apache.org Message-Id: <7ec983945b874a3b81f50c9ebfcf0705@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: spark git commit: [SPARK-7711] Add a startTime property to match the corresponding one in Scala Date: Thu, 21 May 2015 21:09:15 +0000 (UTC) Repository: spark Updated Branches: refs/heads/branch-1.4 e597692ac -> c9a80fc40 [SPARK-7711] Add a startTime property to match the corresponding one in Scala Author: Holden Karau 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 (cherry picked from commit 6b18cdc1b1284b1d48d637d06a1e64829aeb6202) Signed-off-by: Josh Rosen Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/c9a80fc4 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/c9a80fc4 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/c9a80fc4 Branch: refs/heads/branch-1.4 Commit: c9a80fc40951ea9190ef24ca4faf969e5f86bba7 Parents: e597692 Author: Holden Karau Authored: Thu May 21 14:08:57 2015 -0700 Committer: Josh Rosen Committed: Thu May 21 14:09:09 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/c9a80fc4/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/c9a80fc4/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: commits-unsubscribe@spark.apache.org For additional commands, e-mail: commits-help@spark.apache.org