|
9 | 9 | import numpy as np
|
10 | 10 | import pytest
|
11 | 11 | import zarr
|
| 12 | +from zarr.storage import FSStore |
12 | 13 |
|
13 | 14 | from rechunker import api
|
14 | 15 |
|
@@ -208,9 +209,9 @@ def test_rechunk_dataset(
|
208 | 209 | xarray = pytest.importorskip("xarray")
|
209 | 210 |
|
210 | 211 | if target_store.startswith("mapper"):
|
211 |
| - fsspec = pytest.importorskip("fsspec") |
212 |
| - target_store = fsspec.get_mapper(str(tmp_path) + target_store) |
213 |
| - temp_store = fsspec.get_mapper(str(tmp_path) + temp_store) |
| 212 | + pytest.importorskip("fsspec") |
| 213 | + target_store = FSStore(str(tmp_path) + target_store) |
| 214 | + temp_store = FSStore(str(tmp_path) + temp_store) |
214 | 215 | else:
|
215 | 216 | target_store = str(tmp_path / target_store)
|
216 | 217 | temp_store = str(tmp_path / temp_store)
|
@@ -445,16 +446,16 @@ def test_rechunk_dask_array(
|
445 | 446 | @pytest.mark.parametrize("temp_store", ["temp.zarr", "mapper.temp.zarr"])
|
446 | 447 | def test_rechunk_group(tmp_path, executor, source_store, target_store, temp_store):
|
447 | 448 | if source_store.startswith("mapper"):
|
448 |
| - fsspec = pytest.importorskip("fsspec") |
449 |
| - store_source = fsspec.get_mapper(str(tmp_path) + source_store) |
450 |
| - target_store = fsspec.get_mapper(str(tmp_path) + target_store) |
451 |
| - temp_store = fsspec.get_mapper(str(tmp_path) + temp_store) |
| 449 | + pytest.importorskip("fsspec") |
| 450 | + store_source = FSStore(str(tmp_path) + source_store) |
| 451 | + target_store = FSStore(str(tmp_path) + target_store) |
| 452 | + temp_store = FSStore(str(tmp_path) + temp_store) |
452 | 453 | else:
|
453 | 454 | store_source = str(tmp_path / source_store)
|
454 | 455 | target_store = str(tmp_path / target_store)
|
455 | 456 | temp_store = str(tmp_path / temp_store)
|
456 | 457 |
|
457 |
| - group = zarr.group(store_source) |
| 458 | + group = zarr.group(store_source, overwrite=True) |
458 | 459 | group.attrs["foo"] = "bar"
|
459 | 460 | # 800 byte chunks
|
460 | 461 | a = group.ones("a", shape=(5, 10, 20), chunks=(1, 10, 20), dtype="f4")
|
|
0 commit comments