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/10/25 09:32:33 UTC

[GitHub] [spark] itholic commented on a diff in pull request #38385: [SPARK-40907][PS][SQL] `PandasMode` should copy keys before inserting into Map

itholic commented on code in PR #38385:
URL: https://github.com/apache/spark/pull/38385#discussion_r1004236295


##########
python/pyspark/pandas/tests/test_dataframe.py:
##########
@@ -6044,6 +6044,19 @@ def test_mode(self):
         with self.assertRaises(ValueError):
             psdf.mode(axis=2)
 
+        def f(index, iterator):
+            return ["3", "3", "3", "3", "4"] if index == 3 else ["0", "1", "2", "3", "4"]
+
+        rdd = self.spark.sparkContext.parallelize(
+            [
+                1,
+            ],
+            4,

Review Comment:
   nit: can we just is one or two line some thing like:
   
   ```python
   rdd = self.spark.sparkContext.parallelize([1], 4)
       .mapPartitionsWithIndex(f)
   ```
   
   ?? I suspect it's maybe adjusted by black script tho, 😂 



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