From 2abbdc6ecba16bcec503b9037d9a56add416ffcb Mon Sep 17 00:00:00 2001 From: Aashish Saini <141953346+ShorthillsAI@users.noreply.github.com> Date: Fri, 6 Oct 2023 01:07:56 +0530 Subject: [PATCH] Update bageldb.py (#11421) I have restructured the code to ensure uniform handling of ImportError. In place of previously used ValueError, I've adopted the standard practice of raising ImportError with explanatory messages. This modification enhances code readability and clarifies that any problems stem from module importation. --- libs/langchain/langchain/vectorstores/bageldb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/langchain/langchain/vectorstores/bageldb.py b/libs/langchain/langchain/vectorstores/bageldb.py index c2119739d..fbf5df78e 100644 --- a/libs/langchain/langchain/vectorstores/bageldb.py +++ b/libs/langchain/langchain/vectorstores/bageldb.py @@ -108,7 +108,7 @@ class Bagel(VectorStore): try: import bagel # noqa: F401 except ImportError: - raise ValueError("Please install bagel `pip install betabageldb`.") + raise ImportError("Please install bagel `pip install betabageldb`.") return self._cluster.find( query_texts=query_texts, query_embeddings=query_embeddings,