From 39c836e976fcae51568bed5ebab28e148383b5d4 Mon Sep 17 00:00:00 2001 From: Liwei Lin Date: Wed, 13 Jul 2016 22:30:46 -0700 Subject: [SPARK-16503] SparkSession should provide Spark version ## What changes were proposed in this pull request? This patch enables SparkSession to provide spark version. ## How was this patch tested? Manual test: ``` scala> sc.version res0: String = 2.1.0-SNAPSHOT scala> spark.version res1: String = 2.1.0-SNAPSHOT ``` ``` >>> sc.version u'2.1.0-SNAPSHOT' >>> spark.version u'2.1.0-SNAPSHOT' ``` Author: Liwei Lin Closes #14165 from lw-lin/add-version. --- python/pyspark/sql/session.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'python') diff --git a/python/pyspark/sql/session.py b/python/pyspark/sql/session.py index a360fbefa4..594f9375f7 100644 --- a/python/pyspark/sql/session.py +++ b/python/pyspark/sql/session.py @@ -232,6 +232,12 @@ class SparkSession(object): """Returns the underlying :class:`SparkContext`.""" return self._sc + @property + @since(2.0) + def version(self): + """The version of Spark on which this application is running.""" + return self._jsparkSession.version() + @property @since(2.0) def conf(self): -- cgit v1.2.3