Fix some mypy errors and warnings.

This commit is contained in:
Davide Casale
2022-12-22 18:48:23 +01:00
parent 454a7542ed
commit 18f9fef12d

View File

@@ -1,4 +1,4 @@
from typing import Dict, Optional, Any, TypedDict, cast from typing import List, Dict, Optional, Any, TypedDict, cast
from .labeler import _Serializer from .labeler import _Serializer
@@ -19,10 +19,10 @@ class _Notification(_Serializer):
self.serializer = serializer self.serializer = serializer
def parse(self, *values: Any) -> Notification: def parse(self, *values: Any, skip: Optional[List[str]] = None) -> Notification:
notification = dict(self._serialize(*values)) notification = dict(self._serialize(*values))
if self.serializer != None: if isinstance(self.serializer, _Serializer):
notification["NOTIFY_INFO"] = dict(self.serializer._serialize(*notification["NOTIFY_INFO"])) notification["NOTIFY_INFO"] = dict(self.serializer._serialize(*notification["NOTIFY_INFO"], skip=skip))
return cast(Notification, notification) return cast(Notification, notification)