ueshin commented on a change in pull request #35488:
URL: https://github.com/apache/spark/pull/35488#discussion_r821035033



##########
File path: python/pyspark/pandas/utils.py
##########
@@ -467,11 +467,18 @@ def is_testing() -> bool:
 
 def default_session() -> SparkSession:
     spark = SparkSession.getActiveSession()
-    if spark is not None:
-        return spark
+    if spark is None:
+        spark = SparkSession.builder.appName("pandas-on-Spark").getOrCreate()
+
+    if spark.conf.get("spark.sql.ansi.enabled"):

Review comment:
       Currently we always see the warning for the first running this.
   This should be `spark.conf.get("spark.sql.ansi.enabled", "false") == 
"true"`, or `spark._jconf.ansiEnabled`.
   cc @itholic, @HyukjinKwon 

##########
File path: python/pyspark/pandas/utils.py
##########
@@ -467,11 +467,18 @@ def is_testing() -> bool:
 
 def default_session() -> SparkSession:
     spark = SparkSession.getActiveSession()
-    if spark is not None:
-        return spark
+    if spark is None:
+        spark = SparkSession.builder.appName("pandas-on-Spark").getOrCreate()
+
+    if spark.conf.get("spark.sql.ansi.enabled"):

Review comment:
       Currently we always see the warning for the first running this.
   This should be `spark.conf.get("spark.sql.ansi.enabled", "false") == 
"true"`, or `spark._jconf.ansiEnabled()`.
   cc @itholic, @HyukjinKwon 




-- 
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