diff --git a/haystack/preview/document_stores/protocols.py b/haystack/preview/document_stores/protocols.py index d4efd2a47..d01155289 100644 --- a/haystack/preview/document_stores/protocols.py +++ b/haystack/preview/document_stores/protocols.py @@ -5,6 +5,9 @@ from enum import Enum from haystack.preview.dataclasses import Document +# Ellipsis are needed for the type checker, it's safe to disable module-wide +# pylint: disable=unnecessary-ellipsis + logger = logging.getLogger(__name__) @@ -29,17 +32,20 @@ class DocumentStore(Protocol): """ Serializes this store to a dictionary. """ + ... @classmethod def from_dict(cls, data: Dict[str, Any]) -> "DocumentStore": """ Deserializes the store from a dictionary. """ + ... def count_documents(self) -> int: """ Returns the number of documents stored. """ + ... def filter_documents(self, filters: Optional[Dict[str, Any]] = None) -> List[Document]: """ @@ -112,6 +118,7 @@ class DocumentStore(Protocol): :param filters: the filters to apply to the document list. :return: a list of Documents that match the given filters. """ + ... def write_documents(self, documents: List[Document], policy: DuplicatePolicy = DuplicatePolicy.FAIL) -> int: """ @@ -128,6 +135,7 @@ class DocumentStore(Protocol): If DuplicatePolicy.OVERWRITE is used, this number is always equal to the number of documents in input. If DuplicatePolicy.SKIP is used, this number can be lower than the number of documents in the input list. """ + ... def delete_documents(self, document_ids: List[str]) -> None: """ @@ -136,3 +144,4 @@ class DocumentStore(Protocol): :param object_ids: the object_ids to delete """ + ...