haystack
haystack copied to clipboard
refactor: add `return_embedding` param to `get_document(s)_by_id` of `BaseDocumentStore` and all its subclasses.
Related Issues
- fixes #3007
Proposed Changes:
Add return_embedding param to get_document_by_id and get_documents_by_id of BaseDocumentStore and all its subclasses.
How did you test it?
updated test_document_with_embeddings
Notes for the reviewer
params of get_document_by_id() are not in the same order as get_all_documents() to prevent breaking changes.
I tried to be consistent with existing code regarding handling of unused parameters: if a subclass of BaseDocumentStore does not use headers or return_embedding in get_document_by_id() or get_all_documents(), the function will raise an exception when called with a value for these params, but a subclass which is not using batch_size param in get_all_documents() will just ignore it when called with a value for this param.
Checklist
- [x] I have read the contributors guidelines and the code of conduct
- [ ] I have updated the related issue with new insights and changes
- [x] I added tests that demonstrate the correct behavior of the change
- [x] I've used the conventional commit convention for my PR title
- [x] I documented my code
- [x] I ran pre-commit hooks and fixed any issue