Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Davis Bennett <[email protected]>
  • Loading branch information
jhamman and d-v-b authored Nov 8, 2024
1 parent b5e5216 commit 89e8539
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/zarr/api/asynchronous.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,6 @@ async def group(
else:
mode = "r+"
store_mode = _handle_store_mode(mode)
print(f"store_mode: {store_mode}")
store_path = await make_store_path(
store, path=path, mode=store_mode, storage_options=storage_options
)
Expand Down
8 changes: 7 additions & 1 deletion src/zarr/storage/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,13 @@ async def _init(self, mode: AccessModeLiteral) -> None:
match mode:
case "w-":
if not await self.empty():
raise FileExistsError(f"{self} must be empty. Mode is 'w-'")
msg = (
f"{self} is not empty, but `mode` is set to 'w-'."
"Either remove the existing objects in storage,"
"or set `mode` to a value that handles pre-existing objects"
"in storage, like `a` or `w`."
)
raise FileExistsError(msg)
case "w":
await self.delete_dir()
case "a" | "r" | "r+":
Expand Down
4 changes: 0 additions & 4 deletions src/zarr/testing/strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,6 @@ def arrays(
array_path = path + ("/" if not path.endswith("/") else "") + name
root = zarr.open_group(store, mode="w")

# try:
# del root[array_path]
# except KeyError:
# pass

a = root.create_array(
array_path,
Expand Down

0 comments on commit 89e8539

Please sign in to comment.