feat: add run async filter and automerging retriever #9897
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.
Related Issues
Proposed Changes:
Now FilterRetriever and AutoMergingRetriever both support the async method
run_async.The code in
run_asyncis copied from therunmethod, except for the calls to the document store and async helper functions that have been marked and called accordingly with theasync/awaitkeywords.How did you test it?
For each retriever, I created a copy of the original tests adding the suffix
_asyncat the end of the filename.I kept the fixtures from the original file, so there is some duplication.
I kept only the tests regarding the
runmethod, ignoring the initialization tests (since they are not affected by this PR).FilterRetriever had an integration test, so I wrote the equivalent async one.
AutoMergingRetriever does not have any integration tests.
Notes for the reviewer
runandrun_asyncshare a lot of code, but I was cautious because I don't know if you expect me to refactor shared logic into separate functions to avoid the duplication. If that's the case, I'm happy to do that.Unfortunately, the type checking is failing since the general
DocumentStoreclass does not support the async filtering method. The tests are passing because they are usingInMemoryDocumentStore, which actually has that method.Checklist
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:and added!in case the PR includes breaking changes