Skip to content

Commit

Permalink
Checking that the store is an instance of dict seem incorrect.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Carreau committed Oct 22, 2020
1 parent 480d21a commit b339f56
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion zarr/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1821,7 +1821,7 @@ def _encode_chunk(self, chunk):
cdata = chunk

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

return cdata
Expand Down
2 changes: 1 addition & 1 deletion zarr/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def getsize(store, path: Path = None) -> int:
if hasattr(store, 'getsize'):
# pass through
return store.getsize(path)
elif isinstance(store, dict):
elif isinstance(store, MutableMapping):
# compute from size of values
if path in store:
v = store[path]
Expand Down

0 comments on commit b339f56

Please sign in to comment.