Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions zarr/_storage/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ def _ensure_store(store: Any):
"""
from zarr.storage import KVStore # avoid circular import

if store is None:
return None
elif isinstance(store, BaseStore):
if isinstance(store, BaseStore):
if not store._store_version == 2:
raise ValueError(
f"cannot initialize a v2 store with a v{store._store_version} store"
Expand Down
4 changes: 3 additions & 1 deletion zarr/tests/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ class InvalidStore:
with pytest.raises(ValueError):
Store._ensure_store(KVStoreV3(dict()))

assert Store._ensure_store(None) is None
Comment thread
joshmoore marked this conversation as resolved.
# cannot initialize without a store
with pytest.raises(ValueError):
Store._ensure_store(None)


def test_capabilities():
Expand Down