Skip to content

Commit b339f56

Browse files
committed
Checking that the store is an instance of dict seem incorrect.
Indeed MemoryStore is an instance of mutable mapping that have the same property as dict, but woudl not be seen as as instance of dict.
1 parent 480d21a commit b339f56

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

zarr/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1821,7 +1821,7 @@ def _encode_chunk(self, chunk):
18211821
cdata = chunk
18221822

18231823
# ensure in-memory data is immutable and easy to compare
1824-
if isinstance(self.chunk_store, dict):
1824+
if isinstance(self.chunk_store, MutableMapping):
18251825
cdata = ensure_bytes(cdata)
18261826

18271827
return cdata

zarr/storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def getsize(store, path: Path = None) -> int:
176176
if hasattr(store, 'getsize'):
177177
# pass through
178178
return store.getsize(path)
179-
elif isinstance(store, dict):
179+
elif isinstance(store, MutableMapping):
180180
# compute from size of values
181181
if path in store:
182182
v = store[path]

0 commit comments

Comments
 (0)