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

Update base.py #10707

Closed
wants to merge 1 commit into from
Closed

Update base.py #10707

wants to merge 1 commit into from

Conversation

JakubSido
Copy link

@JakubSido JakubSido commented Feb 14, 2024

the if is not evaluated correctly

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Feb 14, 2024
@@ -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):
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm 90% sure I changed this to fix this issue?
#10548

Copy link
Collaborator

Choose a reason for hiding this comment

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

adding await will retintroduce the above issue. But maybe I don't understand whats going on here lol

Copy link

Choose a reason for hiding this comment

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

There is obviously some problem with different versions of the Elastic Python client. After solving issue #10548, the elastic search example in Llamaindex documentation (https://docs.llamaindex.ai/en/stable/examples/vector_stores/ElasticsearchIndexDemo.html) does not work for me anymore. The exists() method returns coroutine and the condition is therefore always true. The index is never created manually, and with the default mapping, dense vector search does not work. Should I update versions of some libraries to get rid of the asynchronous behavior of the exists() method?

Copy link
Collaborator

Choose a reason for hiding this comment

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

If this is a client issue, we should set the minimum client version appropriately in the pyproject.toml so that the code will work

@logan-markewich
Copy link
Collaborator

This has been fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants