Skip to content

Commit 9a1de95

Browse files
committed
Fix typing errors.
1 parent e89af81 commit 9a1de95

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/zarr/core/array.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4588,6 +4588,7 @@ async def init_array(
45884588
order_parsed = zarr_config.get("array.order")
45894589
else:
45904590
order_parsed = order
4591+
chunk_key_encoding_parsed = cast("V2ChunkKeyEncoding", chunk_key_encoding_parsed)
45914592

45924593
meta = AsyncArray._create_metadata_v2(
45934594
shape=shape_parsed,

src/zarr/core/chunk_key_encodings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class ChunkKeyEncoding(ABC, Metadata):
4141
@classmethod
4242
def from_dict(cls, data: dict[str, JSON]) -> Self:
4343
_, config_parsed = parse_named_configuration(data, require_configuration=False)
44-
return cls(**config_parsed if config_parsed else {}) # type: ignore[arg-type]
44+
return cls(**config_parsed if config_parsed else {})
4545

4646
def to_dict(self) -> dict[str, JSON]:
4747
return {"name": self.name, "configuration": super().to_dict()}

tests/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import pathlib
66
from collections.abc import Mapping, Sequence
77
from dataclasses import dataclass, field
8-
from typing import TYPE_CHECKING
8+
from typing import TYPE_CHECKING, cast
99

1010
import numpy as np
1111
import numpy.typing as npt
@@ -50,6 +50,7 @@
5050
from zarr.core.chunk_key_encodings import (
5151
ChunkKeyEncoding,
5252
ChunkKeyEncodingLike,
53+
V2ChunkKeyEncoding,
5354
)
5455
from zarr.core.dtype.wrapper import ZDType
5556

@@ -316,6 +317,7 @@ def create_array_metadata(
316317
filters_parsed, compressor_parsed = _parse_chunk_encoding_v2(
317318
compressor=compressors, filters=filters, dtype=dtype_parsed
318319
)
320+
chunk_key_encoding_parsed = cast("V2ChunkKeyEncoding", chunk_key_encoding_parsed)
319321
return ArrayV2Metadata(
320322
shape=shape_parsed,
321323
dtype=dtype_parsed,

0 commit comments

Comments
 (0)