-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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] elasticsearch vector_store: add await for self.client.indices.exist #11438
Conversation
@@ -239,7 +239,7 @@ async def _create_index_if_not_exists( | |||
index_name: Name of the AsyncElasticsearch index to create. | |||
dims_length: Length of the embedding vectors. | |||
""" | |||
if self.client.indices.exists(index=index_name): | |||
if await self.client.indices.exists(index=index_name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@logan-markewich IIRC I think there was some reason as to why we removed the await
? Or maybe I'm wrong and it never was there to begin with.
I do think we need to have this since the client is and async client though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for visibility on this issue:
- it appears a lower version of
elasticsearch
python client actually does not yield a Coroutine whenclinet.indices.exists
was invoked (see this older issue) -- thereelasticsearch
v8.8.0 was used. - this is no longer the case for the most recent version of
elasticsearch
(at time of this comment, v8.12.1). - since v8.12.1 is the minimum requirement for this integration (i.e. see pyproject.toml), we should be safe to add back
await
now.
…xist (run-llama#11438) await self.client.indices.exist
…xist (run-llama#11438) await self.client.indices.exist
…xist (run-llama#11438) await self.client.indices.exist
Description
AsyncElasticsearchClient
we need to haveawait
onself.client.indices.exist
otherwise it returns aCoroutine
objectFixes #11417
Type of Change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration