@@ -92,7 +92,7 @@ class Metadata2:
92
92
ZARR_FORMAT = ZARR_FORMAT
93
93
94
94
@classmethod
95
- def parse_metadata (cls , s : Union [MappingType , str ]) -> MappingType [str , Any ]:
95
+ def parse_metadata (cls , s : Union [MappingType , bytes , str ]) -> MappingType [str , Any ]:
96
96
97
97
# Here we allow that a store may return an already-parsed metadata object,
98
98
# or a string of JSON that we will parse here. We allow for an already-parsed
@@ -110,7 +110,7 @@ def parse_metadata(cls, s: Union[MappingType, str]) -> MappingType[str, Any]:
110
110
return meta
111
111
112
112
@classmethod
113
- def decode_array_metadata (cls , s : Union [MappingType , str ]) -> MappingType [str , Any ]:
113
+ def decode_array_metadata (cls , s : Union [MappingType , bytes , str ]) -> MappingType [str , Any ]:
114
114
meta = cls .parse_metadata (s )
115
115
116
116
# check metadata format
@@ -198,7 +198,7 @@ def decode_dtype(cls, d) -> np.dtype:
198
198
return np .dtype (d )
199
199
200
200
@classmethod
201
- def decode_group_metadata (cls , s : Union [MappingType , str ]) -> MappingType [str , Any ]:
201
+ def decode_group_metadata (cls , s : Union [MappingType , bytes , str ]) -> MappingType [str , Any ]:
202
202
meta = cls .parse_metadata (s )
203
203
204
204
# check metadata format version
@@ -351,7 +351,7 @@ def encode_dtype(cls, d):
351
351
return get_extended_dtype_info (np .dtype (d ))
352
352
353
353
@classmethod
354
- def decode_group_metadata (cls , s : Union [MappingType , str ]) -> MappingType [str , Any ]:
354
+ def decode_group_metadata (cls , s : Union [MappingType , bytes , str ]) -> MappingType [str , Any ]:
355
355
meta = cls .parse_metadata (s )
356
356
# 1 / 0
357
357
# # check metadata format version
@@ -390,7 +390,7 @@ def encode_hierarchy_metadata(cls, meta=None) -> bytes:
390
390
391
391
@classmethod
392
392
def decode_hierarchy_metadata (
393
- cls , s : Union [MappingType , str ]
393
+ cls , s : Union [MappingType , bytes , str ]
394
394
) -> MappingType [str , Any ]:
395
395
meta = cls .parse_metadata (s )
396
396
# check metadata format
@@ -495,7 +495,7 @@ def _decode_storage_transformer_metadata(cls, meta: Mapping) -> "StorageTransfor
495
495
return StorageTransformerCls .from_config (transformer_type , conf )
496
496
497
497
@classmethod
498
- def decode_array_metadata (cls , s : Union [MappingType , str ]) -> MappingType [str , Any ]:
498
+ def decode_array_metadata (cls , s : Union [MappingType , bytes , str ]) -> MappingType [str , Any ]:
499
499
meta = cls .parse_metadata (s )
500
500
501
501
# extract array metadata fields
0 commit comments