Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions virtualizarr/parsers/zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ def get_metadata(zarr_array: zarr.AsyncArray[Any]) -> ArrayV3Metadata:
zarr_format = zarr_array.metadata.zarr_format

if zarr_format == 2:
# TODO: Once we want to support V2, we will have to deconstruct the
# zarr_array codecs etc. and reconstruct them with create_v3_array_metadata
raise NotImplementedError("Reading Zarr V2 currently not supported.")
# only import this if needed because it's private zarr internals which are likely unstable
from zarr.metadata.migrate_v3 import _convert_array_metadata

return _convert_array_metadata(zarr_array.metadata)
Comment on lines +88 to +90
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi @d-v-b I think this is the piece of API from zarr-developers/zarr-python#3257 that we would ideally like to be exposed as public and stable in zarr-python.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that function will probably need some time to stabilize but in general 💯 to making it public


elif zarr_format == 3:
return zarr_array.metadata
Expand Down
6 changes: 1 addition & 5 deletions virtualizarr/tests/test_parsers/test_zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@
@pytest.mark.parametrize(
"zarr_store",
[
pytest.param(
2,
id="Zarr V2",
marks=pytest.mark.skip(reason="Zarr V2 not currently supported."),
),
pytest.param(2, id="Zarr V2"),
pytest.param(3, id="Zarr V3"),
],
indirect=True,
Expand Down
Loading