-
Notifications
You must be signed in to change notification settings - Fork 617
Open
Labels
enhancementNew feature or request.New feature or request.t-toolingIssues with this label are in the ownership of the tooling team.Issues with this label are in the ownership of the tooling team.
Description
Motivation
Crawlee JS recently added async iterator support (PR #3352) allowing direct iteration over storages:
for await (const item of dataset) { ... }
for await (const [key, value] of kvs) { ... }Python has iterate_items() on Dataset and iterate_keys() on KeyValueStore, but lacks:
__aiter__protocol on Dataset and KeyValueStore — noasync for item in datasetsyntax.iterate_values()/iterate_entries()on KeyValueStore — can only iterate keys, not key-value pairs.
Proposed changes
Dataset
- Add
__aiter__delegating toiterate_items()soasync for item in datasetworks.
KeyValueStore
- Add
iterate_values()— yields values. - Add
iterate_entries()— yields(key, value)tuples. - Add
__aiter__delegating toiterate_entries()soasync for key, value in kvsworks.
JS reference
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request.New feature or request.t-toolingIssues with this label are in the ownership of the tooling team.Issues with this label are in the ownership of the tooling team.