dchvn commented on a change in pull request #34323:
URL: https://github.com/apache/spark/pull/34323#discussion_r738197128
##########
File path: python/pyspark/streaming/listener.py
##########
@@ -15,63 +15,66 @@
# limitations under the License.
#
+from typing import Any
+
+
__all__ = ["StreamingListener"]
class StreamingListener(object):
- def __init__(self):
+ def __init__(self) -> None:
Review comment:
Could you take a look at this
https://mypy.readthedocs.io/en/stable/error_code_list2.html
It have an example:
``` python
class Counter:
# Error: Function is missing a type annotation [no-untyped-def]
def __init__(self):
self.value = 0
class CounterOk:
# OK: An explicit "-> None" is needed if "__init__" takes no arguments
def __init__(self) -> None:
self.value = 0
```
--
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]