Skip to content

Commit 690ffee

Browse files
committed
temp disabled validate_and_normalize_path_to_uri due to issue in zarr-python v3: zarr-developers/zarr-python#2554
1 parent be5280f commit 690ffee

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

virtualizarr/manifests/manifest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ def with_validation(
4949

5050
# note: we can't just use `__init__` or a dataclass' `__post_init__` because we need `fs_root` to be an optional kwarg
5151

52-
path = validate_and_normalize_path_to_uri(path, fs_root=fs_root)
52+
# commenting out for now: https://github.com/zarr-developers/zarr-python/issues/2554
53+
# path = validate_and_normalize_path_to_uri(path, fs_root=fs_root)
5354
validate_byte_range(offset=offset, length=length)
5455
return ChunkEntry(path=path, offset=offset, length=length)
5556

virtualizarr/readers/zarr.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@
99
from xarray import Dataset, Index, Variable
1010

1111
from virtualizarr.manifests import ChunkManifest, ManifestArray
12-
from virtualizarr.manifests.manifest import validate_and_normalize_path_to_uri
1312
from virtualizarr.readers.common import (
1413
VirtualBackend,
1514
construct_virtual_dataset,
1615
open_loadable_vars_and_indexes,
1716
separate_coords,
1817
)
19-
from virtualizarr.utils import _FsspecFSFromFilepath, check_for_collisions
18+
from virtualizarr.utils import check_for_collisions
2019
from virtualizarr.zarr import ZArray
2120

2221
if TYPE_CHECKING:
@@ -154,13 +153,15 @@ def virtual_dataset_from_zarr_group(
154153
) -> Dataset:
155154
import zarr
156155

157-
vfpath = validate_and_normalize_path_to_uri(filepath, fs_root=Path.cwd().as_uri())
156+
# vfpath = validate_and_normalize_path_to_uri(filepath, fs_root=Path.cwd().as_uri())
158157
# This currently fails: *** TypeError: Filesystem needs to support async operations.
159158
# https://github.com/zarr-developers/zarr-python/issues/2554
160159

161-
fss = _FsspecFSFromFilepath(filepath=vfpath, reader_options=reader_options)
160+
# import ipdb; ipdb.set_trace()
162161

163-
zg = zarr.open_group(fss.get_mapper(), mode="r")
162+
zg = zarr.open_group(
163+
filepath, storage_options=reader_options.get("storage_options"), mode="r"
164+
)
164165

165166
zarr_arrays = [val for val in zg.keys()]
166167

virtualizarr/tests/test_integration.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,14 @@ def test_numpy_arrays_to_inlined_kerchunk_refs(
107107
],
108108
indirect=True,
109109
)
110-
def test_zarrV2_roundtrip(zarr_store):
110+
def test_zarr_roundtrip(zarr_store):
111111
ds = open_virtual_dataset(
112112
zarr_store,
113113
indexes={},
114114
)
115+
import ipdb
116+
117+
ipdb.set_trace()
115118
ds_refs = ds.virtualize.to_kerchunk(format="dict")
116119

117120
roundtrip = dataset_from_kerchunk_refs(ds_refs)

0 commit comments

Comments
 (0)