Skip to content

Commit 094eee2

Browse files
author
Joe Hamman
authored
fix consolidate_metadata with FSStore (#916)
1 parent 2d4802c commit 094eee2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

zarr/convenience.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,7 @@ def consolidate_metadata(store: StoreLike, metadata_key=".zmetadata"):
11171117
open_consolidated
11181118
11191119
"""
1120-
store = normalize_store_arg(store)
1120+
store = normalize_store_arg(store, clobber=True)
11211121

11221122
def is_zarr_key(key):
11231123
return (key.endswith('.zarray') or key.endswith('.zgroup') or

zarr/tests/test_storage.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import zarr
2121
from zarr.codecs import BZ2, AsType, Blosc, Zlib
22+
from zarr.convenience import consolidate_metadata
2223
from zarr.errors import MetadataError
2324
from zarr.hierarchy import group
2425
from zarr.meta import ZARR_FORMAT, decode_array_metadata
@@ -1009,6 +1010,10 @@ def test_create(self):
10091010
assert "data" in os.listdir(path1)
10101011
assert ".zgroup" in os.listdir(path1)
10111012

1013+
# consolidated metadata (GH#915)
1014+
consolidate_metadata("file://" + path1)
1015+
assert ".zmetadata" in os.listdir(path1)
1016+
10121017
g = zarr.open_group("simplecache::file://" + path1, mode='r',
10131018
storage_options={"cache_storage": path2,
10141019
"same_names": True})

0 commit comments

Comments
 (0)