Page MenuHomeSoftware Heritage
Paste P894

Command-Line Input
ActivePublic

Authored by douardda on Dec 8 2020, 12:18 PM.
diff --git a/swh/core/api/serializers.py b/swh/core/api/serializers.py
index 30abc9c..1a6d58f 100644
--- a/swh/core/api/serializers.py
+++ b/swh/core/api/serializers.py
@@ -12,7 +12,6 @@ import types
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
from uuid import UUID
-import arrow
import iso8601
import msgpack
from requests import Response
@@ -58,7 +57,6 @@ def dict_to_exception(exc_dict: Dict[str, Any]) -> Exception:
ENCODERS = [
- (arrow.Arrow, "arrow", arrow.Arrow.isoformat),
(datetime.datetime, "datetime", encode_datetime),
(
datetime.timedelta,
@@ -77,7 +75,6 @@ ENCODERS = [
]
DECODERS = {
- "arrow": arrow.get,
"datetime": lambda d: iso8601.parse_date(d, default_timezone=None),
"timedelta": lambda d: datetime.timedelta(**d),
"uuid": UUID,

Event Timeline

douardda updated the paste's language from autodetect to diff.
douardda edited the content of this paste. (Show Details)

after this patch I have:

~/s/s/swh-core  mypy swh
swh/core/api/serializers.py:92: error: List item 0 has incompatible type "List[Tuple[type, str, object]]"; expected "Tuple[Type[Any], str, Callable[..., Any]]"
swh/core/api/serializers.py:94: error: Incompatible return value type (got "List[Tuple[type, str, object]]", expected "List[Tuple[Type[Any], str, Callable[..., Any]]]")
swh/core/api/serializers.py:99: error: List item 0 has incompatible type "Dict[str, object]"; expected "Mapping[str, Callable[..., Any]]"
swh/core/api/serializers.py:101: error: Incompatible return value type (got "Dict[str, object]", expected "Dict[str, Callable[..., Any]]")
Found 4 errors in 1 file (checked 53 source files)