diff --git a/sentinelhub/api/byoc.py b/sentinelhub/api/byoc.py index b379dd29..6c3d94ee 100644 --- a/sentinelhub/api/byoc.py +++ b/sentinelhub/api/byoc.py @@ -47,7 +47,7 @@ class ByocCollectionAdditionalData: other_data: CatchAll = field(default_factory=dict) -@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.INCLUDE) +@dataclass_json(letter_case=LetterCase.CAMEL) @dataclass class ByocCollection(BaseCollection): """Dataclass to hold BYOC collection data""" diff --git a/sentinelhub/api/utils.py b/sentinelhub/api/utils.py index 8a58ebf1..0856f024 100644 --- a/sentinelhub/api/utils.py +++ b/sentinelhub/api/utils.py @@ -21,7 +21,7 @@ letter_case=LetterCase.CAMEL, ) -geometry_config = dataclass_config( # type: ignore[misc] +geometry_config = dataclass_config( encoder=Geometry.get_geojson, decoder=lambda geojson: Geometry.from_geojson(geojson) if geojson else None, exclude=lambda geojson: geojson is None, @@ -31,7 +31,7 @@ def enum_config(enum_class: Type[Enum]) -> Dict[str, dict]: """Given an Enum class it provide an object for serialization/deserialization""" - return dataclass_config( # type: ignore[misc] + return dataclass_config( encoder=lambda enum_item: enum_item.value, decoder=lambda item: enum_class(item) if item else None, exclude=lambda item: item is None, diff --git a/sentinelhub/geometry.py b/sentinelhub/geometry.py index ba44218c..e5491cf0 100644 --- a/sentinelhub/geometry.py +++ b/sentinelhub/geometry.py @@ -6,7 +6,7 @@ import warnings from abc import ABCMeta, abstractmethod from math import ceil -from typing import Callable, Dict, Iterator, Tuple, TypeVar, Union, cast +from typing import Callable, Dict, Iterator, Tuple, TypeVar, Union import shapely.geometry import shapely.geometry.base @@ -159,9 +159,9 @@ def _tuple_from_list_or_tuple( :raises: TypeError """ if len(bbox) == 4: - min_x, min_y, max_x, max_y = cast(Tuple[float, float, float, float], bbox) + min_x, min_y, max_x, max_y = bbox else: - (min_x, min_y), (max_x, max_y) = cast(Tuple[Tuple[float, float], Tuple[float, float]], bbox) + (min_x, min_y), (max_x, max_y) = bbox return float(min_x), float(min_y), float(max_x), float(max_y) @staticmethod