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 2024/01/05 09:52:02 UTC

[PR] [SPARK-46607][PYTHON][TESTS] Check the testing mode [spark]

zhengruifeng opened a new pull request, #44611:
URL: https://github.com/apache/spark/pull/44611

   ### What changes were proposed in this pull request?
   1, Check the testing mode in `ReusedPySparkTestCase` and `ReusedConnectTestCase`
   2, fix the incorrect testing mode introduced in https://github.com/apache/spark/pull/44196
   
   ### Why are the changes needed?
   incorrect usage of `PandasOnSparkTestCase` in parity tests cause test with vanilla Spark Session:
   https://github.com/apache/spark/pull/44196
   https://github.com/apache/spark/pull/44592
   
   
   
   ### Does this PR introduce _any_ user-facing change?
   no
   
   
   ### How was this patch tested?
   ci, added UT
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   no
   


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


Re: [PR] [SPARK-46607][PYTHON][TESTS] Check the testing mode [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on PR #44611:
URL: https://github.com/apache/spark/pull/44611#issuecomment-1878526586

   cc @HyukjinKwon and @itholic please take a look


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


Re: [PR] [SPARK-46607][PYTHON][TESTS] Check the testing mode [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on PR #44611:
URL: https://github.com/apache/spark/pull/44611#issuecomment-1880363583

   thanks @HyukjinKwon and @itholic for reivews


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


Re: [PR] [SPARK-46607][PYTHON][TESTS] Check the testing mode [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on code in PR #44611:
URL: https://github.com/apache/spark/pull/44611#discussion_r1442768884


##########
python/pyspark/pandas/tests/connect/groupby/test_parity_grouping.py:
##########
@@ -19,10 +19,14 @@
 
 from pyspark.pandas.tests.groupby.test_grouping import GroupingTestsMixin
 from pyspark.testing.connectutils import ReusedConnectTestCase
-from pyspark.testing.pandasutils import PandasOnSparkTestCase
+from pyspark.testing.pandasutils import PandasOnSparkTestUtils

Review Comment:
   manually check that, before this fix this test suite fails with
   ```
     test_getitem (pyspark.pandas.tests.connect.groupby.test_parity_grouping.GroupingParityTests.test_getitem) ... ok (0.022s)
     test_assert_vanilla_mode (pyspark.testing.pandasutils.PandasOnSparkTestCase.test_assert_vanilla_mode) ... ok (0.000s)
     test_assert_remote_mode (pyspark.testing.connectutils.ReusedConnectTestCase.test_assert_remote_mode) ... ok (0.000s)
   
   ======================================================================
   FAIL [0.003s]: test_assert_remote_mode (pyspark.pandas.tests.connect.groupby.test_parity_grouping.GroupingParityTests.test_assert_remote_mode)
   ----------------------------------------------------------------------
   Traceback (most recent call last):
     File "/Users/ruifeng.zheng/Dev/spark/python/pyspark/testing/connectutils.py", line 199, in test_assert_remote_mode
       self.assertTrue(is_remote())
   AssertionError: False is not true
   
   ----------------------------------------------------------------------
   Ran 6 tests in 8.455s
   
   ```



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


Re: [PR] [SPARK-46607][PYTHON][TESTS] Check the testing mode [spark]

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on PR #44611:
URL: https://github.com/apache/spark/pull/44611#issuecomment-1880226914

   Merged to master.


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


Re: [PR] [SPARK-46607][PYTHON][TESTS] Check the testing mode [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on code in PR #44611:
URL: https://github.com/apache/spark/pull/44611#discussion_r1442768884


##########
python/pyspark/pandas/tests/connect/groupby/test_parity_grouping.py:
##########
@@ -19,10 +19,14 @@
 
 from pyspark.pandas.tests.groupby.test_grouping import GroupingTestsMixin
 from pyspark.testing.connectutils import ReusedConnectTestCase
-from pyspark.testing.pandasutils import PandasOnSparkTestCase
+from pyspark.testing.pandasutils import PandasOnSparkTestUtils

Review Comment:
   manually check that, before this fix this test suite fails with
   ```
   ======================================================================
   FAIL [0.003s]: test_assert_remote_mode (pyspark.pandas.tests.connect.groupby.test_parity_grouping.GroupingParityTests.test_assert_remote_mode)
   ----------------------------------------------------------------------
   Traceback (most recent call last):
     File "/Users/ruifeng.zheng/Dev/spark/python/pyspark/testing/connectutils.py", line 199, in test_assert_remote_mode
       self.assertTrue(is_remote())
   AssertionError: False is not true
   
   ----------------------------------------------------------------------
   Ran 6 tests in 8.455s
   ```



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


Re: [PR] [SPARK-46607][PYTHON][TESTS] Check the testing mode [spark]

Posted by "itholic (via GitHub)" <gi...@apache.org>.
itholic commented on code in PR #44611:
URL: https://github.com/apache/spark/pull/44611#discussion_r1443587179


##########
python/pyspark/testing/connectutils.py:
##########
@@ -192,3 +192,8 @@ def setUpClass(cls):
     def tearDownClass(cls):
         shutil.rmtree(cls.tempdir.name, ignore_errors=True)
         cls.spark.stop()
+
+    def test_assert_remote_mode(self):
+        from pyspark.sql import is_remote
+
+        self.assertTrue(is_remote())

Review Comment:
   +1



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


Re: [PR] [SPARK-46607][PYTHON][TESTS] Check the testing mode [spark]

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon closed pull request #44611: [SPARK-46607][PYTHON][TESTS] Check the testing mode
URL: https://github.com/apache/spark/pull/44611


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