You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/05/02 23:37:48 UTC

[GitHub] [spark] HyukjinKwon commented on a diff in pull request #36432: [SPARK-39029][PYTHON][TEST]Improve the test coverage for pyspark/broadcast.py

HyukjinKwon commented on code in PR #36432:
URL: https://github.com/apache/spark/pull/36432#discussion_r863260273


##########
python/pyspark/tests/test_broadcast.py:
##########
@@ -99,6 +101,30 @@ def test_broadcast_value_against_gc(self):
         finally:
             b.destroy()
 
+    def test_broadcast_when_sc_none(self):
+        # SPARK-39029 : Test case to improve test coverage of broadcast.py
+        # It test the case when sc is none and Broadcast is called at executor

Review Comment:
   ```suggestion
           # It tests the case when SparkContext is none and Broadcast is called at executor
   ```



##########
python/pyspark/tests/test_broadcast.py:
##########
@@ -99,6 +101,30 @@ def test_broadcast_value_against_gc(self):
         finally:
             b.destroy()
 
+    def test_broadcast_when_sc_none(self):
+        # SPARK-39029 : Test case to improve test coverage of broadcast.py
+        # It test the case when sc is none and Broadcast is called at executor
+        conf = SparkConf()
+        conf.setMaster("local-cluster[2,1,1024]")
+        self.sc = SparkContext(conf=conf)
+        bs = self.sc.broadcast([10])
+        bs_sc_none = Broadcast(sc=None, path=bs._path)
+        self.assertEqual(bs_sc_none.value, [10])
+
+    def test_broadcast_for_error_condition(self):
+        # SPARK-39029: Test case to improve test coverage of broadcast.py
+        # It test the case when broadcast should raise error .

Review Comment:
   ```suggestion
           # It tests the case when broadcast should raise error .
   ```



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