jonmio commented on code in PR #54429:
URL: https://github.com/apache/spark/pull/54429#discussion_r2847927124


##########
python/pyspark/sql/session.py:
##########
@@ -610,12 +610,16 @@ def create(self) -> "SparkSession":
                 from pyspark.core.context import SparkContext
 
                 with self._lock:
-                    # Build SparkConf from options
-                    sparkConf = SparkConf()
-                    for key, value in self._options.items():
-                        sparkConf.set(key, str(value))
-
-                    sc = SparkContext.getOrCreate(sparkConf)
+                    session = SparkSession._instantiatedSession

Review Comment:
   Yes create always returns a new session. We are just reusing the sc of the 
instantiated session if it exists. I renamed the variables to make this more 
clear



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to