Skip to content

Commit 93b61fc

Browse files
committed
more merge conflict resolution
1 parent 7800f38 commit 93b61fc

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

src/zarr/storage/common.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ async def make_store_path(
8282
mode: AccessModeLiteral | None = None,
8383
storage_options: dict[str, Any] | None = None,
8484
) -> StorePath:
85-
from zarr.store.remote import RemoteStore # circular import
85+
from zarr.storage.remote import RemoteStore # circular import
8686

8787
used_storage_options = False
8888

@@ -91,10 +91,14 @@ async def make_store_path(
9191
raise ValueError(
9292
f"mode mismatch (mode={mode} != store.mode={store_like.store.mode.str})"
9393
)
94+
if storage_options:
95+
raise TypeError("storage_options passed but store has already been initialized")
9496
return store_like
9597
elif isinstance(store_like, Store):
9698
if (mode is not None) and (AccessMode.from_literal(mode) != store_like.mode):
9799
raise ValueError(f"mode mismatch (mode={mode} != store.mode={store_like.mode.str})")
100+
if storage_options:
101+
raise TypeError("storage_options passed but store has already been initialized")
98102
await store_like._ensure_open()
99103
result = StorePath(store_like)
100104
elif store_like is None:
@@ -116,6 +120,8 @@ async def make_store_path(
116120
elif isinstance(store_like, dict):
117121
# We deliberate only consider dict[str, Buffer] here, and not arbitrary mutable mappings.
118122
# By only allowing dictionaries, which are in-memory, we know that MemoryStore appropriate.
123+
if mode is None:
124+
mode = "r"
119125
result = StorePath(await MemoryStore.open(store_dict=store_like, mode=mode))
120126
else:
121127
msg = f"Unsupported type for store_like: '{type(store_like).__name__}'" # type: ignore[unreachable]

tests/v3/test_attributes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import zarr.core
22
import zarr.core.attributes
3-
import zarr.store
3+
import zarr.storage
44

55

66
def test_put() -> None:
7-
store = zarr.store.MemoryStore({}, mode="w")
7+
store = zarr.storage.MemoryStore({}, mode="w")
88
attrs = zarr.core.attributes.Attributes(
99
zarr.Group.from_store(store, attributes={"a": 1, "b": 2})
1010
)

tests/v3/test_store/test_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ async def test_make_store_path_fsspec(monkeypatch) -> None:
5959
)
6060
async def test_make_store_path_storage_options_raises(store_like: StoreLike) -> None:
6161
with pytest.raises(TypeError, match="storage_options"):
62-
await make_store_path(store_like, storage_options={"foo": "bar"}, mode="w")
62+
await make_store_path(store_like, storage_options={"foo": "bar"})
6363

6464

6565
async def test_unsupported() -> None:

tests/v3/test_sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import zarr
88
from zarr.core.sync import SyncError, SyncMixin, _get_lock, _get_loop, sync
9-
from zarr.store.memory import MemoryStore
9+
from zarr.storage.memory import MemoryStore
1010

1111

1212
@pytest.fixture(params=[True, False])

0 commit comments

Comments
 (0)