File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1120,7 +1120,6 @@ def is_zarr_key(key):
1120
1120
return (key .endswith ('.zarray' ) or key .endswith ('.zgroup' ) or
1121
1121
key .endswith ('.zattrs' ))
1122
1122
1123
- # out = {key: store[key].decode() for key in store if is_zarr_key(key)}
1124
1123
out = {
1125
1124
'zarr_consolidated_format' : 1 ,
1126
1125
'metadata' : {
Original file line number Diff line number Diff line change @@ -34,13 +34,21 @@ def json_dumps(o):
34
34
35
35
36
36
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
+
37
43
if isinstance (s , Mapping ):
38
44
# assume metadata has already been parsed into a mapping object
39
45
meta = s
46
+
40
47
else :
41
48
# assume metadata needs to be parsed as JSON
42
49
s = ensure_str (s )
43
50
meta = json .loads (s )
51
+
44
52
return meta
45
53
46
54
You can’t perform that action at this time.
0 commit comments