Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: index response error compatible with stack and redis 8 #54

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

wjohnsto
Copy link
Contributor

It appears redis8-M03 throws "no such index" when an index is not found where redis-stack throws "Unknown index name". This covers both cases.

Copy link
Collaborator

@bsbodden bsbodden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks

@bsbodden bsbodden merged commit cc69882 into langchain-ai:main Feb 13, 2025
12 checks passed
@@ -107,7 +107,8 @@ def _ensure_index(self) -> None:
try:
self.redis_client.ft(self.index_name).info()
except ResponseError as e:
if str(e).lower() == "unknown index name":
msg = str(e).lower()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bsbodden eventually we should wrap this kind of stuff in RedisVL -- also fyi index.info() from rvl wraps this piece for you. We also have index.exists() :)

@wjohnsto wjohnsto deleted the fix/index-error branch February 18, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants