Skip to content

Commit 96273a8

Browse files
committed
fix type checking errors
1 parent d665e42 commit 96273a8

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

src/zarr/codecs/arrow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def from_dict(cls, data: dict[str, JSON]) -> Self:
3232
data, "arrow-ipc", require_configuration=False
3333
)
3434
configuration_parsed = configuration_parsed or {}
35-
return cls(**configuration_parsed)
35+
return cls(**configuration_parsed) # type: ignore[arg-type]
3636

3737
def to_dict(self) -> dict[str, JSON]:
3838
return {"name": "arrow_ipc", "configuration": {"column_name": self.column_name}}

src/zarr/core/metadata/v3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ def validate_codecs(codecs: tuple[Codec, ...], dtype: ZDType[TBaseDType, TBaseSc
105105
# TODO: use codec ID instead of class name
106106
codec_class_name = abc.__class__.__name__
107107
# TODO: Fix typing here
108-
if isinstance(dtype, VariableLengthUTF8) and codec_class_name not in (
108+
if isinstance(dtype, VariableLengthUTF8) and codec_class_name not in ( # type: ignore[unreachable]
109109
"VLenUTF8Codec",
110110
"ArrowIPCCodec",
111-
): # type: ignore[unreachable]
111+
):
112112
raise ValueError(
113113
f"For string dtype, ArrayBytesCodec must be `VLenUTF8Codec`, got `{codec_class_name}`."
114114
)

tests/test_codecs/test_arrow.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import io
2+
from typing import Any
23

34
import numpy as np
45
import pytest
@@ -28,7 +29,9 @@
2829

2930

3031
@pytest.mark.parametrize("numpy_array_and_zdtype", numpy_array_fixtures)
31-
async def test_arrow_codec_round_trip(numpy_array_and_zdtype) -> None:
32+
async def test_arrow_codec_round_trip(
33+
numpy_array_and_zdtype: tuple[np.ndarray[Any, Any], zarr.dtype.ZDType[Any, Any] | None],
34+
) -> None:
3235
numpy_array, zdtype = numpy_array_and_zdtype
3336
if zdtype is None:
3437
spec_dtype = parse_dtype(numpy_array.dtype, zarr_format=3)
@@ -88,8 +91,8 @@ def test_string_array() -> None:
8891

8992
a = zarr.create_array(
9093
shape=4,
91-
chunks=2,
92-
dtype=zarr.dtype.VariableLengthUTF8(),
94+
chunks=(2,),
95+
dtype=zarr.dtype.VariableLengthUTF8(), # type: ignore[arg-type]
9396
serializer=ArrowIPCCodec(),
9497
store=zarr.storage.MemoryStore(),
9598
)

0 commit comments

Comments
 (0)