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/04/25 08:11:21 UTC

[PR] [SPARK-47987][PYTHON][CONNECT][TESTS] Reenable `ArrowParityTests.test_createDataFrame_empty_partition` [spark]

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

   ### What changes were proposed in this pull request?
   Reenable `ArrowParityTests.test_createDataFrame_empty_partition`
   
   We actually already had set up Classic SparkContext `_legacy_sc ` for Spark Connect test, so only need to add `_legacy_sc` in Classic PySpark test.
   
   
   ### Why are the changes needed?
   to improve test coverage
   
   
   ### Does this PR introduce _any_ user-facing change?
   no, test only
   
   ### How was this patch tested?
   ci
   
   
   ### 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-47987][PYTHON][CONNECT][TESTS] Enable `ArrowParityTests.test_createDataFrame_empty_partition` [spark]

Posted by "dongjoon-hyun (via GitHub)" <gi...@apache.org>.
dongjoon-hyun closed pull request #46220: [SPARK-47987][PYTHON][CONNECT][TESTS] Enable `ArrowParityTests.test_createDataFrame_empty_partition`
URL: https://github.com/apache/spark/pull/46220


-- 
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-47987][PYTHON][CONNECT][TESTS] Enable `ArrowParityTests.test_createDataFrame_empty_partition` [spark]

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


##########
python/pyspark/sql/tests/test_arrow.py:
##########
@@ -830,7 +830,7 @@ def test_createDataFrame_empty_partition(self):
         pdf = pd.DataFrame({"c1": [1], "c2": ["string"]})
         df = self.spark.createDataFrame(pdf)
         self.assertEqual([Row(c1=1, c2="string")], df.collect())
-        self.assertGreater(self.spark.sparkContext.defaultParallelism, len(pdf))
+        self.assertGreater(self._legacy_sc.defaultParallelism, len(pdf))

Review Comment:
   so we have 3 testing mode:
   1, spark classic (with jvm access);
   2, spark connect (with jvm (`_legacy_sc`) access);
   3, spark connect python only (no jvm)



##########
python/pyspark/sql/tests/test_arrow.py:
##########
@@ -830,7 +830,7 @@ def test_createDataFrame_empty_partition(self):
         pdf = pd.DataFrame({"c1": [1], "c2": ["string"]})
         df = self.spark.createDataFrame(pdf)
         self.assertEqual([Row(c1=1, c2="string")], df.collect())
-        self.assertGreater(self.spark.sparkContext.defaultParallelism, len(pdf))
+        self.assertGreater(self._legacy_sc.defaultParallelism, len(pdf))

Review Comment:
   so we have 3 testing modes now:
   1, spark classic (with jvm access);
   2, spark connect (with jvm (`_legacy_sc`) access);
   3, spark connect python only (no jvm)



-- 
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-47987][PYTHON][CONNECT][TESTS] Enable `ArrowParityTests.test_createDataFrame_empty_partition` [spark]

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


##########
python/pyspark/sql/tests/test_arrow.py:
##########
@@ -830,7 +830,7 @@ def test_createDataFrame_empty_partition(self):
         pdf = pd.DataFrame({"c1": [1], "c2": ["string"]})
         df = self.spark.createDataFrame(pdf)
         self.assertEqual([Row(c1=1, c2="string")], df.collect())
-        self.assertGreater(self.spark.sparkContext.defaultParallelism, len(pdf))
+        self.assertGreater(self._legacy_sc.defaultParallelism, len(pdf))

Review Comment:
   ah, let me see



-- 
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-47987][PYTHON][CONNECT][TESTS] Enable `ArrowParityTests.test_createDataFrame_empty_partition` [spark]

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


##########
python/pyspark/sql/tests/test_arrow.py:
##########
@@ -830,7 +830,7 @@ def test_createDataFrame_empty_partition(self):
         pdf = pd.DataFrame({"c1": [1], "c2": ["string"]})
         df = self.spark.createDataFrame(pdf)
         self.assertEqual([Row(c1=1, c2="string")], df.collect())
-        self.assertGreater(self.spark.sparkContext.defaultParallelism, len(pdf))
+        self.assertGreater(self._legacy_sc.defaultParallelism, len(pdf))

Review Comment:
   added, please take another 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-47987][PYTHON][CONNECT][TESTS] Enable `ArrowParityTests.test_createDataFrame_empty_partition` [spark]

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


##########
python/pyspark/sql/tests/test_arrow.py:
##########
@@ -830,7 +830,7 @@ def test_createDataFrame_empty_partition(self):
         pdf = pd.DataFrame({"c1": [1], "c2": ["string"]})
         df = self.spark.createDataFrame(pdf)
         self.assertEqual([Row(c1=1, c2="string")], df.collect())
-        self.assertGreater(self.spark.sparkContext.defaultParallelism, len(pdf))
+        self.assertGreater(self._legacy_sc.defaultParallelism, len(pdf))

Review Comment:
   Wait, this won't be available in `pyspark-connect`. Can we skip if `pyspark.util.is_remote_only`?



-- 
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-47987][PYTHON][CONNECT][TESTS] Reenable `ArrowParityTests.test_createDataFrame_empty_partition` [spark]

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


##########
python/pyspark/sql/tests/test_arrow.py:
##########
@@ -830,7 +830,7 @@ def test_createDataFrame_empty_partition(self):
         pdf = pd.DataFrame({"c1": [1], "c2": ["string"]})
         df = self.spark.createDataFrame(pdf)
         self.assertEqual([Row(c1=1, c2="string")], df.collect())
-        self.assertGreater(self.spark.sparkContext.defaultParallelism, len(pdf))
+        self.assertGreater(self._legacy_sc.defaultParallelism, len(pdf))

Review Comment:
   `self._legacy_sc` is available in both Spark Connect and Spark Classic, so missing `Spark Context` won't be a blocker any more



-- 
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-47987][PYTHON][CONNECT][TESTS] Enable `ArrowParityTests.test_createDataFrame_empty_partition` [spark]

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

   thank you @dongjoon-hyun and @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: 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