Skip to content

Commit

Permalink
Fix mypy and ruff errors
Browse files Browse the repository at this point in the history
  • Loading branch information
abarciauskas-bgse committed Nov 22, 2024
1 parent 39677e8 commit 5fa7177
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion virtualizarr/codecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ def _get_zarr_array_codecs(
raise NotImplementedError(
f"zarr-python v3 or higher is required, but version {installed_version} is installed."
)
from zarr.core.metadata import ArrayV2Metadata, ArrayV3Metadata
from zarr.core.metadata import ( # type: ignore[import-untyped]
ArrayV2Metadata,
ArrayV3Metadata,
)

# For zarr format v3
if isinstance(array.metadata, ArrayV3Metadata):
Expand Down
4 changes: 2 additions & 2 deletions virtualizarr/writers/icechunk.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import TYPE_CHECKING, Optional, cast
from typing import TYPE_CHECKING, List, Optional, Union, cast

import numpy as np
from xarray import Dataset
Expand Down Expand Up @@ -150,7 +150,7 @@ def get_axis(
def check_compatible_arrays(
ma: "ManifestArray", existing_array: "Array", append_axis: int
):
arrays = [ma, existing_array] # type: List[Union[ManifestArray, Array]]
arrays: List[Union[ManifestArray, Array]] = [ma, existing_array]
check_same_dtypes([arr.dtype for arr in arrays])
check_same_codecs([get_codecs(arr, normalize_to_zarr_v3=True) for arr in arrays])
check_same_chunk_shapes([arr.chunks for arr in arrays])
Expand Down

0 comments on commit 5fa7177

Please sign in to comment.