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

Fix for 592 #594

Merged
merged 4 commits into from
Nov 16, 2023
Merged

Fix for 592 #594

merged 4 commits into from
Nov 16, 2023

Conversation

dblock
Copy link
Member

@dblock dblock commented Nov 16, 2023

Description

Go back to try/catch for requiring async code.

Issues Resolved

Closes #592.

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.

Signed-off-by: dblock <dblock@amazon.com>
Signed-off-by: dblock <dblock@amazon.com>
Copy link

codecov bot commented Nov 16, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (4874437) 71.87% compared to head (75f6d05) 71.86%.

Files Patch % Lines
opensearchpy/__init__.py 80.00% 2 Missing ⚠️
opensearchpy/connection/__init__.py 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #594      +/-   ##
==========================================
- Coverage   71.87%   71.86%   -0.02%     
==========================================
  Files          89       89              
  Lines        7922     7932      +10     
==========================================
+ Hits         5694     5700       +6     
- Misses       2228     2232       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -45,6 +45,14 @@
@nox.session(python=["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]) # type: ignore
def test(session: Any) -> None:
session.install(".")
# ensure client can be imported without aiohttp
session.run("python", "-c", "import opensearchpy\nprint(opensearchpy.OpenSearch())")
Copy link
Member Author

Choose a reason for hiding this comment

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

This reproduces #592 without the fix.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I have full faith that this should work, but looking through the tests I don't think we do a nox test in any of the CIs. I think we really need to add that.

harshavamsi
harshavamsi previously approved these changes Nov 16, 2023
@@ -45,6 +45,14 @@
@nox.session(python=["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]) # type: ignore
def test(session: Any) -> None:
session.install(".")
# ensure client can be imported without aiohttp
session.run("python", "-c", "import opensearchpy\nprint(opensearchpy.OpenSearch())")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I have full faith that this should work, but looking through the tests I don't think we do a nox test in any of the CIs. I think we really need to add that.

Signed-off-by: dblock <dblock@amazon.com>
@dblock
Copy link
Member Author

dblock commented Nov 16, 2023

@harshavamsi You are absolutely right. Switch to using nox in CI.

Copy link
Collaborator

@harshavamsi harshavamsi left a comment

Choose a reason for hiding this comment

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

Looking at a random run I see that nox is picking up opensearch from the install. LGTM!

@harshavamsi harshavamsi merged commit cec268e into opensearch-project:main Nov 16, 2023
56 of 57 checks passed
@dblock dblock deleted the fix-592 branch November 16, 2023 00:46
roma2023 pushed a commit to roma2023/opensearch-py that referenced this pull request Dec 28, 2023
* Prepare for next developer iteration, 2.4.1.

Signed-off-by: dblock <dblock@amazon.com>

* Fix: sync opensearchpy without iohttp.

Signed-off-by: dblock <dblock@amazon.com>

* Use nox to run tests.

Signed-off-by: dblock <dblock@amazon.com>

---------

Signed-off-by: dblock <dblock@amazon.com>
Signed-off-by: roma2023 <romasaparhan19@gmail.com>
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.

[BUG] 2.4.0 introduces hard dependency on aiohttp
2 participants