Fix type errors

This commit is contained in:
Sumner Evans
2020-07-20 22:40:23 -06:00
parent 2332925fcd
commit 221a22ee50
3 changed files with 9 additions and 4 deletions

View File

@@ -657,7 +657,6 @@ class Adapter(abc.ABC):
only be ``True`` if :class:`supports_streaming` returns ``True``.
:returns: The URI for the given song.
"""
# TODO (#189)
raise self._check_can_error("get_song_uri")
def get_song_details(self, song_id: str) -> Song:

View File

@@ -29,11 +29,15 @@ encoder_functions = {
for type_, translation_function in decoder_functions.items():
dataclasses_json.cfg.global_config.decoders[type_] = translation_function
dataclasses_json.cfg.global_config.decoders[Optional[type_]] = translation_function
dataclasses_json.cfg.global_config.decoders[
Optional[type_] # type: ignore
] = translation_function
for type_, translation_function in encoder_functions.items():
dataclasses_json.cfg.global_config.encoders[type_] = translation_function
dataclasses_json.cfg.global_config.encoders[Optional[type_]] = translation_function
dataclasses_json.cfg.global_config.encoders[
Optional[type_] # type: ignore
] = translation_function
@dataclass_json(letter_case=LetterCase.CAMEL)

View File

@@ -18,7 +18,9 @@ def encode_path(path: Path) -> str:
dataclasses_json.cfg.global_config.decoders[Path] = Path
dataclasses_json.cfg.global_config.decoders[Optional[Path]] = (
dataclasses_json.cfg.global_config.decoders[
Optional[Path] # type: ignore
] = (
lambda p: Path(p) if p else None
)