Skip to content

Commit

Permalink
Fixed Import Error type in base.py (langchain-ai#10209)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ShorthillsAI authored Sep 13, 2023
1 parent a43abf2 commit 201b61d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/langchain/langchain/vectorstores/redis/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ def _create_index(self, dim: int = 1536) -> None:
)

except ImportError:
raise ValueError(
raise ImportError(
"Could not import redis python package. "
"Please install it with `pip install redis`."
)
Expand Down

0 comments on commit 201b61d

Please sign in to comment.