Support chaining FindQuery filters - #844
Open
lh0156 wants to merge 1 commit into
Open
Conversation
lh0156
marked this pull request as ready for review
July 30, 2026 09:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements #780 by allowing
FindQueryinstances to accept additional filter expressions through.find().What changed
FindQuery.find(*expressions)and returns a new query, leaving the original unchanged.Model.find(expr1, expr2).Testing
pytest -q tests/test_find_query.py tests_sync/test_find_query.py: 52 passed.pytest -q tests --ignore tests/test_benchmarks.py: 261 passed.pytest -q tests_sync --ignore tests_sync/test_benchmarks.py: 261 passed.ruff checkandruff format --checkon changed source/tests.python -m compileall -q aredis_om tests.bandit -q -r aredis_om/model/model.py -s B608.Redis Stack was run locally through Docker Compose for the integration tests; benchmark tests were excluded from the full run.
Note
Low Risk
Small additive API on FindQuery using existing copy/execute paths; behavior is covered by tests with no auth or data-migration impact.
Overview
Adds
FindQuery.find(*expressions)so you can append filters on an existing query instead of only passing them all at once toModel.find(). Each call returns a new query viacopy(); the prior query is unchanged. New expressions are AND-combined with existing ones, matchingModel.find(expr1, expr2), and KNN state is carried forward when chaining.Docs in
querying.mdshow building filters incrementally. Async integration coverage confirms chaining behavior and immutability of the base query.Reviewed by Cursor Bugbot for commit 1a42823. Bugbot is set up for automated code reviews on this repo. Configure here.