diff --git a/virtualizarr/parsers/zarr.py b/virtualizarr/parsers/zarr.py index e94c456d..caf2376c 100644 --- a/virtualizarr/parsers/zarr.py +++ b/virtualizarr/parsers/zarr.py @@ -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) elif zarr_format == 3: return zarr_array.metadata diff --git a/virtualizarr/tests/test_parsers/test_zarr.py b/virtualizarr/tests/test_parsers/test_zarr.py index b38f00ef..a30c1cce 100644 --- a/virtualizarr/tests/test_parsers/test_zarr.py +++ b/virtualizarr/tests/test_parsers/test_zarr.py @@ -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,