Skip to content

Commit 4bc70bd

Browse files
authored
Update get method to use default buffer prototype (#3581)
Set default value for prototype parameter in get method.
1 parent 7d0b62d commit 4bc70bd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/zarr/storage/_memory.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from zarr.abc.store import ByteRequest, Store
77
from zarr.core.buffer import Buffer, gpu
8+
from zarr.core.buffer.core import default_buffer_prototype
89
from zarr.core.common import concurrent_map
910
from zarr.storage._utils import _normalize_byte_range_index
1011

@@ -79,10 +80,12 @@ def __eq__(self, other: object) -> bool:
7980
async def get(
8081
self,
8182
key: str,
82-
prototype: BufferPrototype,
83+
prototype: BufferPrototype | None = None,
8384
byte_range: ByteRequest | None = None,
8485
) -> Buffer | None:
8586
# docstring inherited
87+
if prototype is None:
88+
prototype = default_buffer_prototype()
8689
if not self._is_open:
8790
await self._open()
8891
assert isinstance(key, str)

0 commit comments

Comments
 (0)