Skip to content

Commit

Permalink
Fix python style
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryshao committed Jan 29, 2018
1 parent ec94c05 commit d9f77ea
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/pyspark/sql/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ def __init__(self, sparkContext, jsparkSession=None):
self._jvm = self._sc._jvm
if jsparkSession is None:
if self._jvm.SparkSession.getDefaultSession().isDefined() \
and not self._jvm.SparkSession.getDefaultSession().get().sparkContext().isStopped():
and not self._jvm.SparkSession.getDefaultSession().get() \
.sparkContext().isStopped():
jsparkSession = self._jvm.SparkSession.getDefaultSession().get()
else:
jsparkSession = self._jvm.SparkSession(self._jsc.sc())
Expand All @@ -230,7 +231,7 @@ def __init__(self, sparkContext, jsparkSession=None):
or SparkSession._instantiatedSession._sc._jsc is None:
SparkSession._instantiatedSession = self
if self._jvm.SparkSession.getDefaultSession().isEmpty() \
or not jsparkSession.equals(self._jvm.SparkSession.getDefaultSession().get()):
or not jsparkSession.equals(self._jvm.SparkSession.getDefaultSession().get()):
self._jvm.SparkSession.setDefaultSession(self._jsparkSession)

def _repr_html_(self):
Expand Down

0 comments on commit d9f77ea

Please sign in to comment.