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
maxrjones and d-v-b authored Jan 13, 2025
1 parent dd0de05 commit 4dba40c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/zarr/storage/_fsspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ async def set(
await self._open()
self._check_writable()
if not isinstance(value, Buffer):
raise TypeError("FsspecStore.set(): `value` must a Buffer instance")
raise TypeError(f"FsspecStore.set(): `value` must a Buffer instance. Got an instance of {type(value)} instead.")
path = _dereference_path(self.path, key)
# write data
if byte_range:
Expand Down
2 changes: 1 addition & 1 deletion src/zarr/testing/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ async def test_set_many(self, store: S) -> None:
for k, v in store_dict.items():
assert (await self.get(store, k)).to_bytes() == v.to_bytes()

async def test_set_raises(self, store: S) -> None:
async def test_set_invalid_buffer(self, store: S) -> None:
"""
Ensure that set raises a Type or Value Error for invalid buffer arguments.
"""
Expand Down
4 changes: 2 additions & 2 deletions tests/test_store/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@pytest.mark.parametrize("zarr_format", [2, 3])
async def test_contains_group(local_store, write_group: bool, zarr_format: ZarrFormat) -> None:
"""
Test contains group method
Test that the contains_group method correctly reports the existence of a group.
"""
root = Group.from_store(store=local_store, zarr_format=zarr_format)
if write_group:
Expand All @@ -28,7 +28,7 @@ async def test_contains_group(local_store, write_group: bool, zarr_format: ZarrF
@pytest.mark.parametrize("zarr_format", [2, 3])
async def test_contains_array(local_store, write_array: bool, zarr_format: ZarrFormat) -> None:
"""
Test contains group method
Test that the contains array method correctly reports the existence of an array.
"""
root = Group.from_store(store=local_store, zarr_format=zarr_format)
if write_array:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_store/test_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def test_invalid_root_raises(self):

async def test_get_with_prototype_default(self, store: LocalStore):
"""
Ensure that data can be read using the default prototype method.
Ensure that data can be read via ``store.get`` if the prototype keyword argument is unspecified, i.e. set to ``None``.
"""
data_buf = self.buffer_cls.from_bytes(b"\x01\x02\x03\x04")
key = "c/0"
Expand Down

0 comments on commit 4dba40c

Please sign in to comment.