You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zhengruifeng (via GitHub)" <gi...@apache.org> on 2023/08/18 00:32:16 UTC

[GitHub] [spark] zhengruifeng commented on a diff in pull request #42548: [WIP][SPARK-44750][PYTHON][CONNECT] Apply configuration to sparksession during creation

zhengruifeng commented on code in PR #42548:
URL: https://github.com/apache/spark/pull/42548#discussion_r1297874638


##########
python/pyspark/sql/tests/connect/test_connect_basic.py:
##########
@@ -3346,6 +3346,25 @@ def test_can_create_multiple_sessions_to_different_remotes(self):
             PySparkSession.builder.create()
             self.assertIn("Create a new SparkSession is only supported with SparkConnect.", str(e))
 
+class SparkConnectSessionWithOptionsTest(ReusedConnectTestCase):
+    def setUp(self) -> None:
+        self.spark = (
+            PySparkSession.builder
+            .config("spark.sql.adaptive.enabled", False)
+            .appName(self.__class__.__name__)
+            .remote("local[4]")
+            .getOrCreate()
+        )
+
+    def tearDown(self):
+        self.spark.stop()
+
+    def test_config(self):
+        # Config
+        self.assertEqual(self.spark.conf.get("spark.sql.adaptive.enabled"), "false")
+        with self.assertRaises(SparkConnectException) as e:
+            self.spark.conf.get("some.conf")

Review Comment:
   I think the two lines are not needed



##########
python/pyspark/testing/connectutils.py:
##########
@@ -167,6 +167,7 @@ def conf(cls):
         Override this in subclasses to supply a more specific conf
         """
         conf = SparkConf(loadDefaults=False)
+        conf.set("spark.sql.legacy.setCommandRejectsSparkCoreConfs", "false")

Review Comment:
   why we need this change?



-- 
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-unsubscribe@spark.apache.org

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


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