Yicong-Huang commented on code in PR #53974:
URL: https://github.com/apache/spark/pull/53974#discussion_r2732656644


##########
python/pyspark/worker.py:
##########
@@ -3149,15 +3153,17 @@ def batch_from_offset(batch, offsets):
                 names=[batch.schema.names[o] for o in offsets],
             )
 
-        def mapper(a):
-            batch_iter = iter(a)
+        def mapper(batches):

Review Comment:
   yes! I wanted to enforce it but since we have multiple definitions of 
mappers, they have to share the same signature/type hints. 
   
   In my [previous 
attempt](https://github.com/Yicong-Huang/spark/actions/runs/21350971724/job/61447600948)
 mypy is complaining: 
   ```
   starting mypy annotations test...
   annotations failed mypy checks:
   python/pyspark/worker.py:3156: error: All conditional function variants must 
have identical signatures  [misc]
   python/pyspark/worker.py:3156: note: Original:
   python/pyspark/worker.py:3156: note:     def mapper(series_iter: Any) -> Any
   python/pyspark/worker.py:3156: note: Redefinition:
   python/pyspark/worker.py:3156: note:     def mapper(batches: Iterable[Any]) 
-> Any
   Found 1 error in 1 file (checked 1195 source files)
   ```
   
   Maybe we can change all of them together in a PR?



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