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

Add async compatible classes #1480

Closed
wants to merge 10 commits into from
Closed

Conversation

sethmlarson
Copy link
Contributor

@sethmlarson sethmlarson commented Jan 14, 2021

Closes #921
Closes #1355

TODOs:

  • Figure out Mapping functions that use I/O, my first thought is to deprecate them in 7.x and remove in 8.x
    and instead use the Mapping class as only for storing metadata. These functions don't appear to be used anywhere
    in the codebase so shouldn't have a big impact on users?
  • See if we can leverage unasync for unit tests as well? Either way need to test the new Async classes
  • Add section of documentation on Async variants of Search, etc
  • Document that AsyncSearch doesn't have anything to do with the /_async_search/* endpoints
  • Add section in contribution documentation on the meaning of _async/, _base, and _sync directories
  • Try to move all the imports to the top of files, in theory this should be possible now because of _base
  • Create an example FastAPI application with AsyncDocument and AsyncFacetedSearch (captured in issue Create an example FastAPI application with AsyncDocument and AsyncFacetedSearch #1482)

@clmnin
Copy link

clmnin commented Jan 23, 2021

With pull request sethmlarson#1 we've removed the Mapping function and added a fix for failing imports.

Can I take up this task?

Create an example FastAPI application with AsyncDocument and AsyncFacetedSearch

What should this app do? Do we have a sync equivalent of this?

@cla-checker-service
Copy link

cla-checker-service bot commented Jan 25, 2021

💚 CLA has been signed

@sethmlarson
Copy link
Contributor Author

sethmlarson commented Jan 25, 2021

@clmno You certainly can, I'll create individual issues for tasks that don't need to be finished in this PR so you can work in tandem.

Also, can you sign the CLA? Much appreciated!

@clmnin
Copy link

clmnin commented Jan 25, 2021

@seth-goodwin I've signed the CLA

@zikphil
Copy link

zikphil commented Feb 22, 2021

@sethmlarson How would I go about installing this locally and test it out?

pip3 install git+https://github.com/sethmlarson/elasticsearch-dsl-py.git@async-io

When I run this, the Async classes do not seem to be loaded.

@MerlijnElderhuis
Copy link

Would love to know what @zikphil asked as well!

@jellex
Copy link

jellex commented Mar 23, 2021

@sethmlarson I tried using AsyncSearh with next code:

from elasticsearch_dsl import AsyncSearch

search = AsyncSearch(using='my_connection_name', index='my_index_name')
search = search.filter('term', docType='my_docType_name')
result = search.count()

and I get the following error:

  <...>
  File "<..>/elasticsearch_dsl/_async/search.py", line 430, in count
    return await es.count(index=self._index, body=d, **self._params)["count"]
TypeError: 'coroutine' object is not subscriptable

I fix this the next code:

count = await es.count(index=self._index, body=d, **self._params)
return count["count"]

Proposal: fix this error similar code

maybe later I prepare PR

Edit: ready sethmlarson#2

@nicholasamorim
Copy link

Any chance this can be merged?

@jamesrappazzo
Copy link

Any update on this?

@bizd-sk
Copy link

bizd-sk commented Sep 28, 2021

When this AsyncSearch feature will be availble.. I don't see part of 7.4 release

@sethmlarson
Copy link
Contributor Author

Sorry all, I've been focused on work in the client lately so this work has been put on hold.

@milani
Copy link

milani commented Nov 23, 2021

@sethmlarson thanks for the hard work. Do you think much has remained for this PR? Any on guess when it would be available?

@rocco8620
Copy link

@sethmlarson
Hello, i am interested too in this functionality, any update on when it may be available? Is there anything i can do to help?
Thank you :)

@nxhuy-github
Copy link

Hi, I am very interested in this functionality. May I ask why we don't merge this feature, please? Any update, please?
Many thanks

@dima-kov
Copy link

hey team, thank you so much for all the efforts. Could you please tell us more when do you expect to make it public?

@sla-te sla-te mentioned this pull request Sep 7, 2023
@pquentin pquentin mentioned this pull request Apr 3, 2024
16 tasks
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.

Add support for async I/O Integration of official async ES client into DSL library