haystack icon indicating copy to clipboard operation
haystack copied to clipboard

refactor: add `return_embedding` param to `get_document(s)_by_id` of `BaseDocumentStore` and all its subclasses.

Open camillepradel opened this issue 2 years ago • 0 comments

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

camillepradel avatar Aug 25 '22 07:08 camillepradel