16
16
from zarr .core .config import config
17
17
18
18
if TYPE_CHECKING :
19
- from collections .abc import AsyncGenerator , Coroutine , Iterable
19
+ from collections .abc import AsyncGenerator , Coroutine , Iterable , Sequence
20
20
from typing import Any
21
21
22
22
from obstore import ListResult , ListStream , ObjectMeta , OffsetRange , SuffixRange
@@ -216,14 +216,14 @@ def list(self) -> AsyncGenerator[str, None]:
216
216
# docstring inherited
217
217
import obstore as obs
218
218
219
- objects : ListStream [list [ObjectMeta ]] = obs .list (self .store )
219
+ objects : ListStream [Sequence [ObjectMeta ]] = obs .list (self .store )
220
220
return _transform_list (objects )
221
221
222
222
def list_prefix (self , prefix : str ) -> AsyncGenerator [str , None ]:
223
223
# docstring inherited
224
224
import obstore as obs
225
225
226
- objects : ListStream [list [ObjectMeta ]] = obs .list (self .store , prefix = prefix )
226
+ objects : ListStream [Sequence [ObjectMeta ]] = obs .list (self .store , prefix = prefix )
227
227
return _transform_list (objects )
228
228
229
229
def list_dir (self , prefix : str ) -> AsyncGenerator [str , None ]:
@@ -235,7 +235,7 @@ def list_dir(self, prefix: str) -> AsyncGenerator[str, None]:
235
235
236
236
237
237
async def _transform_list (
238
- list_stream : ListStream [list [ObjectMeta ]],
238
+ list_stream : ListStream [Sequence [ObjectMeta ]],
239
239
) -> AsyncGenerator [str , None ]:
240
240
"""
241
241
Transform the result of list into an async generator of paths.
@@ -246,7 +246,8 @@ async def _transform_list(
246
246
247
247
248
248
async def _transform_list_dir (
249
- list_result_coroutine : Coroutine [Any , Any , ListResult [list [ObjectMeta ]]], prefix : str
249
+ list_result_coroutine : Coroutine [Any , Any , ListResult [Sequence [ObjectMeta ]]],
250
+ prefix : str ,
250
251
) -> AsyncGenerator [str , None ]:
251
252
"""
252
253
Transform the result of list_with_delimiter into an async generator of paths.
0 commit comments