diff --git a/virtualizarr/writers/icechunk.py b/virtualizarr/writers/icechunk.py index 0cc54d1f..34435843 100644 --- a/virtualizarr/writers/icechunk.py +++ b/virtualizarr/writers/icechunk.py @@ -1,4 +1,4 @@ -from typing import TYPE_CHECKING, cast +from typing import TYPE_CHECKING, Sequence, cast import numpy as np from xarray import Dataset @@ -149,13 +149,13 @@ def write_manifest_virtual_refs( # but Icechunk need to expose a suitable API first it = np.nditer( [manifest._paths, manifest._offsets, manifest._lengths], - flags=[ + flags=cast(Sequence[np._NDIterFlagsKind], [ "refs_ok", "multi_index", "c_index", # TODO is "c_index" correct? what's the convention for zarr chunk keys? - ], - op_flags=[["readonly"]] * 3, # type: ignore - ) # type: ignore + ]), + op_flags=cast(Sequence[Sequence[np._NDIterOpFlagsKind]], [["readonly"]] * 3), + ) for path, offset, length in it: index = it.multi_index chunk_key = "/".join(str(i) for i in index) diff --git a/virtualizarr/zarr.py b/virtualizarr/zarr.py index 966c76b1..d1c5cf3c 100644 --- a/virtualizarr/zarr.py +++ b/virtualizarr/zarr.py @@ -157,9 +157,10 @@ def _v3_codec_pipeline(self) -> Any: ``` """ try: + # type: ignore[import-untyped] from zarr.core.metadata.v3 import ( parse_codecs, - ) # type: ignore[import-untyped] + ) except ImportError: raise ImportError("zarr v3 is required to generate v3 codec pipelines")