|
6 | 6 | from itertools import starmap |
7 | 7 | from typing import TYPE_CHECKING, Protocol, runtime_checkable |
8 | 8 |
|
| 9 | +from zarr.core.buffer.core import default_buffer_prototype |
| 10 | +from zarr.core.common import concurrent_map |
| 11 | +from zarr.core.config import config |
| 12 | + |
9 | 13 | if TYPE_CHECKING: |
10 | 14 | from collections.abc import AsyncGenerator, AsyncIterator, Iterable |
11 | 15 | from types import TracebackType |
@@ -434,7 +438,6 @@ async def getsize(self, key: str) -> int: |
434 | 438 | # Note to implementers: this default implementation is very inefficient since |
435 | 439 | # it requires reading the entire object. Many systems will have ways to get the |
436 | 440 | # size of an object without reading it. |
437 | | - from zarr.core.buffer.core import default_buffer_prototype |
438 | 441 |
|
439 | 442 | value = await self.get(key, prototype=default_buffer_prototype()) |
440 | 443 | if value is None: |
@@ -474,8 +477,6 @@ async def getsize_prefix(self, prefix: str) -> int: |
474 | 477 | # on to getting sizes. Ideally we would overlap those two, which should |
475 | 478 | # improve tail latency and might reduce memory pressure (since not all keys |
476 | 479 | # would be in memory at once). |
477 | | - from zarr.core.common import concurrent_map |
478 | | - from zarr.core.config import config |
479 | 480 |
|
480 | 481 | keys = [(x,) async for x in self.list_prefix(prefix)] |
481 | 482 | limit = config.get("async.concurrency") |
|
0 commit comments