cloud-fan commented on code in PR #49930:
URL: https://github.com/apache/spark/pull/49930#discussion_r1957014751


##########
python/pyspark/sql/session.py:
##########
@@ -480,7 +480,11 @@ def getOrCreate(self) -> "SparkSession":
             from pyspark.core.context import SparkContext
 
             with self._lock:
-                is_api_mode_connect = opts.get("spark.api.mode", 
"classic").lower() == "connect"
+                default_api_mode = "classic"
+                if os.environ.get("SPARK_CONNECT_MODE", "") == "1":
+                    default_api_mode = "connect"
+
+                is_api_mode_connect = opts.get("spark.api.mode", 
default_api_mode).lower() == "connect"

Review Comment:
   ```suggestion
                   is_api_mode_connect = (
                       opts.get("spark.api.mode", default_api_mode).lower() == 
"connect"
                   )
   ```



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to