Skip to content

Commit 89e8539

Browse files
jhammand-v-b
andauthored
Apply suggestions from code review
Co-authored-by: Davis Bennett <[email protected]>
1 parent b5e5216 commit 89e8539

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/zarr/api/asynchronous.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,6 @@ async def group(
627627
else:
628628
mode = "r+"
629629
store_mode = _handle_store_mode(mode)
630-
print(f"store_mode: {store_mode}")
631630
store_path = await make_store_path(
632631
store, path=path, mode=store_mode, storage_options=storage_options
633632
)

src/zarr/storage/common.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,13 @@ async def _init(self, mode: AccessModeLiteral) -> None:
6666
match mode:
6767
case "w-":
6868
if not await self.empty():
69-
raise FileExistsError(f"{self} must be empty. Mode is 'w-'")
69+
msg = (
70+
f"{self} is not empty, but `mode` is set to 'w-'."
71+
"Either remove the existing objects in storage,"
72+
"or set `mode` to a value that handles pre-existing objects"
73+
"in storage, like `a` or `w`."
74+
)
75+
raise FileExistsError(msg)
7076
case "w":
7177
await self.delete_dir()
7278
case "a" | "r" | "r+":

src/zarr/testing/strategies.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,6 @@ def arrays(
138138
array_path = path + ("/" if not path.endswith("/") else "") + name
139139
root = zarr.open_group(store, mode="w")
140140

141-
# try:
142-
# del root[array_path]
143-
# except KeyError:
144-
# pass
145141

146142
a = root.create_array(
147143
array_path,

0 commit comments

Comments
 (0)