Add iter()/aiter() for filter-based lazy iteration
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- Python
- Stars
- 427
- Forks
- 101
- Avg merge
- 6d 3h
- Merged PRs (30d)
- 20
Description
Summary
Add lazy filter-based ID/key iteration APIs for index maintenance and agent pipelines.
Level: Intermediate
Current State
paginate()yields full document records, not IDs/keys only.scan_by_pattern()works on raw Redis key patterns and returns a materialized list.- No index filter-expression based generator for IDs/keys.
Proposed Change
- Add lazy iterators over keys included in an index in Redis optionally applying some filtering:
iter(filter_expression...)aiter(filter_expression,...)
- Yield as a generator of said keys?
Definition of Done
- Iteration is lazy (streaming batches, no full list required).
- Works for selective and wildcard filter expressions.
- Integration tests verify complete and deterministic coverage.
Out of Scope
- Arbitrary cursor checkpoints or resumable iterators.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the existing paginate() and scan_by_pattern() implementations and their integration tests first, then trace the index filter-expression paths for both sync and async APIs. Done means selective and wildcard expressions lazily stream complete, deterministic key coverage without materializing the full result, with integration tests verifying both iterators.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, redis
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100