opensearch-project / opensearch-py

Python Client for OpenSearch
https://opensearch.org/docs/latest/clients/python/
Apache License 2.0
338 stars 170 forks source link

FIX: Remove HEAD -> GET request swap workaround #699

Closed vcastane closed 1 month ago

vcastane commented 6 months ago

Description

Remove a workaround replacing HEAD requests with GET requests for async requests. This workaround is no longer needed after the underlying bug was fixed in https://github.com/aio-libs/aiohttp/pull/5012

Issues Resolved

Partially resolves https://github.com/opensearch-project/opensearch-py/issues/698 The rest of the issue is user (my) error.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 72.16%. Comparing base (bd91530) to head (9560795). Report is 52 commits behind head on main.

Files Patch % Lines
opensearchpy/_async/http_aiohttp.py 50.00% 1 Missing :warning:
opensearchpy/connection/http_async.py 50.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #699 +/- ## ========================================== + Coverage 72.14% 72.16% +0.01% ========================================== Files 89 89 Lines 7945 7943 -2 ========================================== Hits 5732 5732 + Misses 2213 2211 -2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

dblock commented 6 months ago

Is there a way to write a test for this, too? Something that fails without this change?

saimedhi commented 6 months ago

Do we need to lock aiohttp >= a certain version as part of the PR?

saimedhi commented 6 months ago
  • I suggest instead of locking aiohttp to >=3.7.0,<4, we should check the aiohttp version and conditionally remove the workaround for aiohttp >=3.7.0.

Disregard the previous comment. To resolve this issue #715 , we're planning to lock aiohttp to >=3.9.2,<4. Thus, simply removing the workaround should suffice."

saimedhi commented 4 months ago

Hello @vcastane ,

Could you please take a look at finishing this PR when you have a moment? If you need any help, let us know.

Thanks a lot!

dblock commented 1 month ago

Finished this in https://github.com/opensearch-project/opensearch-py/pull/794.