From 56d116d281cb7209c9583c6398a7f02ab40890ab Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Thu, 26 Sep 2024 09:13:50 +0200 Subject: [PATCH] Apply ruff/flake8-annotations rule ANN204 ANN204 Missing return type annotation for special method `__init__` --- src/zarr/core/metadata/v2.py | 2 +- src/zarr/core/metadata/v3.py | 2 +- src/zarr/store/zip.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/zarr/core/metadata/v2.py b/src/zarr/core/metadata/v2.py index 27c1badafd..4a9baaf8b8 100644 --- a/src/zarr/core/metadata/v2.py +++ b/src/zarr/core/metadata/v2.py @@ -52,7 +52,7 @@ def __init__( compressor: numcodecs.abc.Codec | dict[str, JSON] | None = None, filters: Iterable[numcodecs.abc.Codec | dict[str, JSON]] | None = None, attributes: dict[str, JSON] | None = None, - ): + ) -> None: """ Metadata for a Zarr version 2 array. """ diff --git a/src/zarr/core/metadata/v3.py b/src/zarr/core/metadata/v3.py index f1cb07fd4c..16bfc822a5 100644 --- a/src/zarr/core/metadata/v3.py +++ b/src/zarr/core/metadata/v3.py @@ -72,7 +72,7 @@ def parse_dimension_names(data: object) -> tuple[str | None, ...] | None: class V3JsonEncoder(json.JSONEncoder): - def __init__(self, *args: Any, **kwargs: Any): + def __init__(self, *args: Any, **kwargs: Any) -> None: self.indent = kwargs.pop("indent", config.get("json_indent")) super().__init__(*args, **kwargs) diff --git a/src/zarr/store/zip.py b/src/zarr/store/zip.py index 2c3b16a65d..cd9df4d374 100644 --- a/src/zarr/store/zip.py +++ b/src/zarr/store/zip.py @@ -56,7 +56,7 @@ def __init__( mode: ZipStoreAccessModeLiteral = "r", compression: int = zipfile.ZIP_STORED, allowZip64: bool = True, - ): + ) -> None: super().__init__(mode=mode) if isinstance(path, str):