zero323 commented on a change in pull request #34439: URL: https://github.com/apache/spark/pull/34439#discussion_r753859207
########## File path: python/pyspark/broadcast.py ########## @@ -21,28 +21,47 @@ from tempfile import NamedTemporaryFile import threading import pickle +from typing import ( + cast, + Any, + Callable, + Dict, + Generic, + IO, + Iterator, + Optional, + Tuple, + TypeVar, + TYPE_CHECKING, + Union, +) from pyspark.java_gateway import local_connect_and_auth from pyspark.serializers import ChunkedStream, pickle_protocol from pyspark.util import print_exec +if TYPE_CHECKING: + from pyspark import SparkContext + __all__ = ["Broadcast"] +T = TypeVar("T") + # Holds broadcasted data received from Java, keyed by its id. -_broadcastRegistry = {} +_broadcastRegistry: Dict[int, "Broadcast"] = {} Review comment: Let's avoid implicit `Any` ‒ `Dict[int, "Broadcast[Any]"]` -- 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