File tree Expand file tree Collapse file tree
src/crawlee/storage_clients/_file_system Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -185,14 +185,10 @@ async def iterate_items(
185185 f'by the { self .__class__ .__name__ } client.'
186186 )
187187
188- # The native client returns a list rather than an async iterator,
189- # so we fetch all matching items and yield them one by one.
190- items : list [Any ] = await self ._native_client .iterate_items (
188+ async for item in self ._native_client .iterate_items (
191189 offset = offset ,
192190 limit = limit ,
193191 desc = desc ,
194192 skip_empty = skip_empty ,
195- )
196-
197- for item in items :
193+ ):
198194 yield item
Original file line number Diff line number Diff line change @@ -139,14 +139,10 @@ async def iterate_keys(
139139 exclusive_start_key : str | None = None ,
140140 limit : int | None = None ,
141141 ) -> AsyncIterator [KeyValueStoreRecordMetadata ]:
142- # The native client returns a list, so we fetch all matching keys
143- # and yield them one by one.
144- items : list [dict [str , Any ]] = await self ._native_client .iterate_keys (
142+ async for item in self ._native_client .iterate_keys (
145143 exclusive_start_key = exclusive_start_key ,
146144 limit = limit ,
147- )
148-
149- for item in items :
145+ ):
150146 yield KeyValueStoreRecordMetadata (** item )
151147
152148 @override
You can’t perform that action at this time.
0 commit comments