Skip to content

Commit 467f6bd

Browse files
committed
Fix Dataset.iterate_items
Fix typing issue. Abstract AsyncIterator can't be defined with async and missing yield. https://stackoverflow.com/questions/68905848/how-to-correctly-specify-type-hints-with-asyncgenerator-and-asynccontextmanager
1 parent e26a323 commit 467f6bd

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/crawlee/base_storage_client/_base_dataset_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ async def list_items(
8787
"""
8888

8989
@abstractmethod
90-
async def iterate_items(
90+
def iterate_items(
9191
self,
9292
*,
9393
offset: int = 0,

src/crawlee/memory_storage_client/_dataset_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ async def list_items(
203203
)
204204

205205
@override
206-
async def iterate_items( # type: ignore
206+
async def iterate_items(
207207
self,
208208
*,
209209
offset: int = 0,

src/crawlee/storages/_dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ async def iterate_items(
404404
Yields:
405405
Each item from the dataset as a dictionary.
406406
"""
407-
async for item in self._resource_client.iterate_items( # type: ignore
407+
async for item in self._resource_client.iterate_items(
408408
offset=offset,
409409
limit=limit,
410410
clean=clean,

0 commit comments

Comments
 (0)