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 support for async I/O #1203

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1044939
Initial commit adding async support
sethmlarson Apr 16, 2020
74e683b
Add unasync-ing of _async gen code
sethmlarson Apr 17, 2020
0d82870
lint
sethmlarson Apr 17, 2020
d504b7f
Address review comments
sethmlarson Apr 20, 2020
754ea31
Move _normalize_hosts into utils
sethmlarson Apr 20, 2020
75218cc
Merge branch 'master' into add-async
sethmlarson Apr 20, 2020
56d49a3
Add AsyncTransport sniffing
sethmlarson Apr 22, 2020
e703d33
Merge branch 'add-async' of ssh://github.com/elastic/elasticsearch-py…
sethmlarson Apr 22, 2020
e7228fb
Merge branch 'master' of ssh://github.com/elastic/elasticsearch-py in…
sethmlarson Apr 29, 2020
aaed0d4
Add tests for AIOHttpConnection
sethmlarson Apr 29, 2020
020cc6f
Add tests for AsyncTransport, async helpers
sethmlarson May 5, 2020
262c1bb
checkpoint
sethmlarson May 7, 2020
490d69c
Fixed bug in async_streaming_bulk()
sethmlarson May 7, 2020
ee597ce
All async helper tests passing
sethmlarson May 7, 2020
1742803
Add [async] deps to dev-requirements.txt
sethmlarson May 8, 2020
d0ad40d
Add AsyncConnectionPool tests
sethmlarson May 8, 2020
01037c2
Add pytest for async REST API tests
sethmlarson May 8, 2020
2ed861a
Skip proper tests for async REST API
sethmlarson May 11, 2020
252c0fc
Add documentation for async helpers and API
sethmlarson May 11, 2020
30c6976
Always use AIOHttpConnection for async tests
sethmlarson May 11, 2020
82531f1
Update sync tests to use pytest setup/teardown
sethmlarson May 11, 2020
5a81989
Update API to latest master, fix order of methods to reduce PR diff
sethmlarson May 11, 2020
96c7d83
Skip v2 index template issues, fix ML cleanup
sethmlarson May 11, 2020
e19674a
Fix async client to use AsyncTransport
sethmlarson May 12, 2020
4d1a9ba
Skip some more tests
sethmlarson May 12, 2020
334c040
Only run REST API tests once per execution
sethmlarson May 12, 2020
b75d420
Also delete index v2 templates
sethmlarson May 13, 2020
e73b6a0
Also delete index aliases?
sethmlarson May 13, 2020
3a88306
Oh yeah we skip that on sync, skip on async too
sethmlarson May 13, 2020
3fbcdda
Use pytest skip marker
sethmlarson May 13, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ pandas
pyyaml<5.3

black; python_version>="3.6"
git+https://github.com/python-trio/unasync
21 changes: 21 additions & 0 deletions elasticsearch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
__version__ = VERSION
__versionstr__ = ".".join(map(str, VERSION))

import sys
import logging
import warnings

Expand Down Expand Up @@ -60,3 +61,23 @@
"AuthorizationException",
"ElasticsearchDeprecationWarning",
]

try:
# Async is only supported on Python 3.6+
if sys.version_info < (3, 6):
raise ImportError()
import asyncio

from ._async import (
AsyncElasticsearch as AsyncElasticsearch,
AsyncTransport as AsyncTransport,
AIOHttpConnection as AIOHttpConnection,
)

__all__ += [
"AsyncElasticsearch",
"AsyncTransport",
"AIOHttpConnection",
]
except ImportError as e:
pass
9 changes: 9 additions & 0 deletions elasticsearch/_async/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from .client import Elasticsearch as AsyncElasticsearch
from .transport import AsyncTransport
from .http_aiohttp import AIOHttpConnection

__all__ = [
"AsyncElasticsearch",
"AsyncTransport",
"AIOHttpConnection",
]
Loading