zero323 commented on a change in pull request #34439:
URL: https://github.com/apache/spark/pull/34439#discussion_r753855694



##########
File path: python/pyspark/broadcast.py
##########
@@ -177,28 +201,28 @@ def destroy(self, blocking=False):
         self._jbroadcast.destroy(blocking)
         os.unlink(self._path)
 
-    def __reduce__(self):
+    def __reduce__(self) -> Tuple[Callable[[int], T], Tuple[int]]:
         if self._jbroadcast is None:
             raise RuntimeError("Broadcast can only be serialized in driver")
-        self._pickle_registry.add(self)
-        return _from_id, (self._jbroadcast.id(),)
+        cast(Any, self._pickle_registry).add(self)
+        return cast(Tuple[Callable[[int], T], Tuple[int]], (_from_id, 
(self._jbroadcast.id(),)))

Review comment:
       https://github.com/apache/spark/pull/34439/files#r753855676




-- 
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-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to