jingz-db commented on code in PR #49560:
URL: https://github.com/apache/spark/pull/49560#discussion_r1953437085


##########
python/pyspark/sql/tests/connect/pandas/test_parity_pandas_transform_with_state.py:
##########
@@ -0,0 +1,61 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+import unittest
+
+from pyspark.sql.tests.pandas.test_pandas_transform_with_state import (
+    TransformWithStateInPandasTestsMixin,
+)
+from pyspark import SparkConf
+from pyspark.testing.connectutils import ReusedConnectTestCase
+
+
+class TransformWithStateInPandasParityTests(
+    TransformWithStateInPandasTestsMixin, ReusedConnectTestCase
+):
+    """
+    Spark connect parity tests for TransformWithStateInPandas. Run every test 
case in
+     `TransformWithStateInPandasTestsMixin` in spark connect mode.
+    """
+
+    @classmethod
+    def conf(cls):
+        cfg = SparkConf(loadDefaults=False)

Review Comment:
   yeah... `conf(cls)` was overwritten in both ReusedConnectTestCase and 
TransformWithStateInPandasTestsMixin. I hit an exception complaining 
`spark.master` cannot be configured at the same time with 
`"SPARK_CONNECT_TESTING_REMOTE", "local[4]"`. This is due to 
`ReusedConnectTestCase` is doing this:
   ```
   @classmethod
   def conf(cls):
         conf = SparkConf(loadDefaults=False)
                 # Make the server terminate reattachable streams every 1 
second and 123 bytes,
                 # to make the tests exercise reattach.
                 if conf._jconf is not None:
                     conf._jconf.remove("spark.master")
                 # other configs are added here
   ```
   While `TransformWithStateInPandasTestsMixin` is doing this:
   ```
   @classmethod
   def conf(cls):
       cfg = SparkConf()
       # other configs are added here
   ```
   I suspect I am hitting the issue because it is indeterministic which 
function will be executed first. After I explicitly constructing conf here by 
adding all configs in the base classes and remove `"spark.master"`, the 
exception goes away.



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