From 201b61d5b32a468615495c8656771bc4811b2d18 Mon Sep 17 00:00:00 2001 From: Aashish Saini <141953346+ShorthillsAI@users.noreply.github.com> Date: Thu, 14 Sep 2023 00:42:58 +0530 Subject: [PATCH] Fixed Import Error type in base.py (#10209) I have revamped the code to ensure uniform error handling for ImportError. Instead of the previous reliance on ValueError, I have adopted the conventional practice of raising ImportError and providing informative error messages. This change enhances code clarity and clearly signifies that any problems are associated with module imports. --- libs/langchain/langchain/vectorstores/redis/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/langchain/langchain/vectorstores/redis/base.py b/libs/langchain/langchain/vectorstores/redis/base.py index 320c6730e3..830a97d1a5 100644 --- a/libs/langchain/langchain/vectorstores/redis/base.py +++ b/libs/langchain/langchain/vectorstores/redis/base.py @@ -1220,7 +1220,7 @@ class Redis(VectorStore): ) except ImportError: - raise ValueError( + raise ImportError( "Could not import redis python package. " "Please install it with `pip install redis`." )