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



##########
File path: python/pyspark/profiler.py
##########
@@ -31,54 +36,51 @@ class ProfilerCollector(object):
     the different stages.
     """
 
-    def __init__(self, profiler_cls, dump_path=None):
-        self.profiler_cls = profiler_cls
-        self.profile_dump_path = dump_path
-        self.profilers = []
+    def __init__(self, profiler_cls: Type["Profiler"], dump_path: 
Optional[str] = None):
+        self.profiler_cls: Type[Profiler] = profiler_cls
+        self.profile_dump_path: Optional[str] = dump_path
+        self.profilers: List[Tuple[int, Profiler, bool]] = []
 
-    def new_profiler(self, ctx):
+    def new_profiler(self, ctx: "SparkContext") -> "Profiler":
         """Create a new profiler using class `profiler_cls`"""
         return self.profiler_cls(ctx)
 
-    def add_profiler(self, id, profiler):
+    def add_profiler(self, id: int, profiler: "Profiler") -> None:
         """Add a profiler for RDD `id`"""
         if not self.profilers:
             if self.profile_dump_path:
                 atexit.register(self.dump_profiles, self.profile_dump_path)
             else:
                 atexit.register(self.show_profiles)
 
-        self.profilers.append([id, profiler, False])
+        self.profilers.append([id, profiler, False])  # type: ignore[arg-type]

Review comment:
       Instead of ignoring this, it might make more sense to append `tuple`, 
but we'll have trace how it is used first.




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