opensearch-project / opensearch-py

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

[FEATURE] Do not rely on import errors for async client imports #595

Open dblock opened 1 year ago

dblock commented 1 year ago

Is your feature request related to a problem?

In https://github.com/opensearch-project/opensearch-py/pull/594 I had to put back code that relies on errors for importing the async client. If iohttp is not available, an exception is raised and the async client is not imported.

What solution would you like?

A more reliable way to check for iohttp. There could be other errors during loading which are currently being lumped together. This potentially hides real bugs.

What alternatives have you considered?

Do nothing.