Skip to content

Commit ccef26c

Browse files
committed
comments [ci skip]
1 parent 9c0c621 commit ccef26c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

zarr/convenience.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,6 @@ def is_zarr_key(key):
11201120
return (key.endswith('.zarray') or key.endswith('.zgroup') or
11211121
key.endswith('.zattrs'))
11221122

1123-
# out = {key: store[key].decode() for key in store if is_zarr_key(key)}
11241123
out = {
11251124
'zarr_consolidated_format': 1,
11261125
'metadata': {

zarr/meta.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,21 @@ def json_dumps(o):
3434

3535

3636
def parse_metadata(s):
37+
38+
# Here we allow that a store may return an already-parsed metadata object,
39+
# or a string of JSON that we will parse here. We allow for an already-parsed
40+
# object to accommodate a consolidated metadata store, where all the metadata for
41+
# all groups and arrays will already have been parsed from JSON.
42+
3743
if isinstance(s, Mapping):
3844
# assume metadata has already been parsed into a mapping object
3945
meta = s
46+
4047
else:
4148
# assume metadata needs to be parsed as JSON
4249
s = ensure_str(s)
4350
meta = json.loads(s)
51+
4452
return meta
4553

4654

0 commit comments

Comments
 (0)