Skip to content

Support chaining FindQuery filters - #844

Draft
lh0156 wants to merge 1 commit into
redis:mainfrom
lh0156:agent/find-query-chain-780
Draft

Support chaining FindQuery filters#844
lh0156 wants to merge 1 commit into
redis:mainfrom
lh0156:agent/find-query-chain-780

Conversation

@lh0156

@lh0156 lh0156 commented Jul 26, 2026

Copy link
Copy Markdown

Summary

Implements #780 by allowing FindQuery instances to accept additional filter expressions through .find().

What changed

  • Adds FindQuery.find(*expressions) and returns a new query, leaving the original unchanged.
  • Appends expressions to the existing query so they use the same AND semantics as Model.find(expr1, expr2).
  • Preserves the query's KNN state when creating the chained query.
  • Documents incremental filter construction.

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 check and ruff format --check on 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant