Skip to content

Commit 1aeb49a

Browse files
committed
fix typing yay!
1 parent cae7055 commit 1aeb49a

File tree

1 file changed

+4
-1
lines changed
  • src/zarr/core/metadata

1 file changed

+4
-1
lines changed

src/zarr/core/metadata/v3.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ def parse_fill_value(
427427

428428
# the rest are numeric types
429429
np_dtype = data_type.to_numpy()
430+
np_dtype = cast(np.dtype[np.generic], np_dtype)
430431

431432
if isinstance(fill_value, Sequence) and not isinstance(fill_value, str):
432433
if data_type in (DataType.complex64, DataType.complex128):
@@ -479,7 +480,9 @@ def default_fill_value(dtype: DataType) -> str | bytes | np.generic:
479480
elif dtype == DataType.bytes:
480481
return b""
481482
else:
482-
return dtype.to_numpy().type(0)
483+
np_dtype = dtype.to_numpy()
484+
np_dtype = cast(np.dtype[np.generic], np_dtype)
485+
return np_dtype.type(0)
483486

484487

485488
# For type checking

0 commit comments

Comments
 (0)