Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9636b49

Browse files
committedJun 7, 2024
Resolve linting issues
Signed-off-by: Amir Karbasi <amir@karbasi.dev>
1 parent 60fea79 commit 9636b49

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed
 

‎src/milvus_haystack/milvus_embedding_retriever.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ def to_dict(self) -> Dict[str, Any]:
3030
:returns:
3131
A dictionary representation of the retriever component.
3232
"""
33-
return default_to_dict(self, document_store=self.document_store.to_dict(), filters=self.filters, top_k=self.top_k)
33+
return default_to_dict(
34+
self, document_store=self.document_store.to_dict(), filters=self.filters, top_k=self.top_k
35+
)
3436

3537
@classmethod
3638
def from_dict(cls, data: Dict[str, Any]) -> "MilvusEmbeddingRetriever":
@@ -42,11 +44,12 @@ def from_dict(cls, data: Dict[str, Any]) -> "MilvusEmbeddingRetriever":
4244
"""
4345
init_params = data.get("init_parameters", {})
4446
if "document_store" not in init_params:
45-
raise DeserializationError("Missing 'document_store' in serialization data")
46-
47+
err_msg = "Missing 'document_store' in serialization data"
48+
raise DeserializationError(err_msg)
49+
4750
docstore = MilvusDocumentStore.from_dict(init_params["document_store"])
4851
data["init_parameters"]["document_store"] = docstore
49-
52+
5053
return default_from_dict(cls, data)
5154

5255
@component.output_types(documents=List[Document])

0 commit comments

Comments
 (0)
Please sign in to comment.