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 2021/10/22 05:17:08 UTC

[GitHub] [spark] HyukjinKwon commented on a change in pull request #34363: [SPARK-37083][PYTHON] Inline type hints for python/pyspark/accumulators.py

HyukjinKwon commented on a change in pull request #34363:
URL: https://github.com/apache/spark/pull/34363#discussion_r734240526



##########
File path: python/pyspark/accumulators.py
##########
@@ -20,20 +20,32 @@
 import struct
 import socketserver as SocketServer
 import threading
+from typing import TypeVar, Generic, Tuple, Callable, Type, Dict, Union, TYPE_CHECKING
+
 from pyspark.serializers import read_int, PickleSerializer
 
+if TYPE_CHECKING:
+    from pyspark._typing import SupportsIAdd
+    import socketserver.BaseRequestHandler  # type: ignore

Review comment:
       why do we need ignore here?

##########
File path: python/pyspark/accumulators.py
##########
@@ -264,7 +281,12 @@ def authenticate_and_accum_updates():
 
 class AccumulatorServer(SocketServer.TCPServer):
 
-    def __init__(self, server_address, RequestHandlerClass, auth_token):
+    def __init__(
+        self,
+        server_address: Tuple[str, int],
+        RequestHandlerClass: Type["socketserver.BaseRequestHandler"],

Review comment:
       what's diff between `Type["socketserver.BaseRequestHandler"]` and `"socketserver.BaseRequestHandler"`?




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