zero323 commented on a change in pull request #34238:
URL: https://github.com/apache/spark/pull/34238#discussion_r725988872
##########
File path: python/pyspark/context.py
##########
@@ -285,24 +340,27 @@ def _do_init(self, master, appName, sparkHome, pyFiles,
environment, batchSize,
dump_path = self._conf.get("spark.python.profile.dump", None)
self.profiler_collector = ProfilerCollector(profiler_cls,
dump_path)
else:
- self.profiler_collector = None
+ self.profiler_collector = None # type: ignore[assignment]
# create a signal handler which would be invoked on receiving SIGINT
- def signal_handler(signal, frame):
+ def signal_handler(signal: Any, frame: Any) -> None:
Review comment:
`signal.signal` [is called with
`_HANDLER`](https://github.com/python/typeshed/blob/ee487304d76c671aa353a15e34bc1102bffa2362/stdlib/signal.pyi#L188)
```python
def signal(__signalnum: _SIGNUM, __handler: _HANDLER) -> _HANDLER: ...
```
which [is an
alias](https://github.com/python/typeshed/blob/ee487304d76c671aa353a15e34bc1102bffa2362/stdlib/signal.pyi#L83)
for:
```python
_HANDLER = Union[Callable[[int, Optional[FrameType]], Any], int, Handlers,
None]
```
--
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]