Skip to content

Commit ac95b4d

Browse files
authored
Pass read_only into LocalStore.open() (#3432)
Currently, `read_only` is not passed in `open()`, which means the default value of `read_only=False` is confusingly used instead. This mostly just surprisng, but also has minor performance implications because `read_only=False` means Zarr attempts to create directories on this line (which is a no-op because `exist_ok=True`): https://github.com/zarr-developers/zarr-python/blob/e738e2fb88dbead26a853d9982ff46eab64f313f/src/zarr/storage/_local.py#L167-L169
1 parent e738e2f commit ac95b4d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/zarr/storage/_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ async def make_store_path(
353353

354354
elif isinstance(store_like, Path):
355355
# Create a new LocalStore
356-
store = await LocalStore.open(root=store_like, mode=mode)
356+
store = await LocalStore.open(root=store_like, mode=mode, read_only=_read_only)
357357

358358
elif isinstance(store_like, str):
359359
# Either a FSSpec URI or a local filesystem path

0 commit comments

Comments
 (0)