Skip to content

Commit

Permalink
Use KVStore when checking for in-memory data
Browse files Browse the repository at this point in the history
Checking against MutableMapping categories all BaseStores as in-memory
stores.
  • Loading branch information
madsbk committed Jan 12, 2022
1 parent d3027f8 commit 287ab92
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zarr/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
is_scalar,
pop_fields,
)
from zarr.storage import array_meta_key, attrs_key, getsize, listdir, BaseStore
from zarr.storage import KVStore, array_meta_key, attrs_key, getsize, listdir, BaseStore
from zarr.util import (
all_equal,
InfoReporter,
Expand Down Expand Up @@ -2153,7 +2153,7 @@ def _encode_chunk(self, chunk):
cdata = chunk

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

return cdata
Expand Down

0 comments on commit 287ab92

Please sign in to comment.