@@ -92,7 +92,7 @@ class Metadata2:
9292 ZARR_FORMAT = ZARR_FORMAT
9393
9494 @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 ]:
9696
9797 # Here we allow that a store may return an already-parsed metadata object,
9898 # 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]:
110110 return meta
111111
112112 @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 ]:
114114 meta = cls .parse_metadata (s )
115115
116116 # check metadata format
@@ -198,7 +198,7 @@ def decode_dtype(cls, d) -> np.dtype:
198198 return np .dtype (d )
199199
200200 @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 ]:
202202 meta = cls .parse_metadata (s )
203203
204204 # check metadata format version
@@ -351,7 +351,7 @@ def encode_dtype(cls, d):
351351 return get_extended_dtype_info (np .dtype (d ))
352352
353353 @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 ]:
355355 meta = cls .parse_metadata (s )
356356 # 1 / 0
357357 # # check metadata format version
@@ -390,7 +390,7 @@ def encode_hierarchy_metadata(cls, meta=None) -> bytes:
390390
391391 @classmethod
392392 def decode_hierarchy_metadata (
393- cls , s : Union [MappingType , str ]
393+ cls , s : Union [MappingType , bytes , str ]
394394 ) -> MappingType [str , Any ]:
395395 meta = cls .parse_metadata (s )
396396 # check metadata format
@@ -495,7 +495,7 @@ def _decode_storage_transformer_metadata(cls, meta: Mapping) -> "StorageTransfor
495495 return StorageTransformerCls .from_config (transformer_type , conf )
496496
497497 @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 ]:
499499 meta = cls .parse_metadata (s )
500500
501501 # extract array metadata fields
0 commit comments