elastic-transport-python icon indicating copy to clipboard operation
elastic-transport-python copied to clipboard

Add support for Aiohttp 4.0

Open sethmlarson opened this issue 5 years ago • 3 comments

Looks like Aiohttp 4.0 changes a few APIs, we should ensure we're compatible so when 3.6 is finally released our users can use it right away.

sethmlarson avatar Jul 20 '20 19:07 sethmlarson

Hey @sethmlarson,

Aiohttp version 3.7.x has been released with the incompatible commit https://github.com/aio-libs/aiohttp/commit/e7e6c2011c0f6d0a1ac3be7a6ced062e443b47fb#diff-b797dd8733928df191ba2061121ab8b69976c185fcbfad4534891d3252b9ac30R100

There is replace of the coroutine function noop by class and it causes raising of TypeError at https://github.com/elastic/elasticsearch-py-async/blob/master/elasticsearch_async/connection.py#L115 because noop is not already iterable.

ShortTerm fix might be downgrade of aiohttp in setup.py (aiohttp<3.7) LongTerm fix might be

  1. catching the TypeError in this library or
  2. add function __iter__(...) to the noop class to get it iterable

I'm able to create the PRs but I'd like to agree on the right solution.

Sparkycz avatar Dec 17 '20 13:12 Sparkycz

@Sparkycz You point at the repository elasticsearch-py-async (elasticsearch-async on PyPI) and this is the repo elasticsearch-py (elasticsearch on PyPI). Has there been a mix-up here? Can you try aiohttp 3.7 after installing elasticsearch[async] as documented here?

sethmlarson avatar Dec 17 '20 15:12 sethmlarson

Yes, It works. Thank you.

Sparkycz avatar Dec 22 '20 06:12 Sparkycz