Repository: deepset-ai/haystack

Issue:
`import haystack` fails on current master
**Describe the bug**
Running 
```python
import haystack
```
on current master (e7627c3f8b241654b61f8523479c81f855102f0a) fails with 

**Error message**
```python
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
File ~/Documents/deepset/code/haystack/haystack/document_stores/opensearch.py:10, in <module>
      9 try:
---> 10     from opensearchpy import OpenSearch, Urllib3HttpConnection, RequestsHttpConnection, NotFoundError, RequestError
     11     from opensearchpy.helpers import bulk

ModuleNotFoundError: No module named 'opensearchpy'

The above exception was the direct cause of the following exception:

ImportError                               Traceback (most recent call last)
Input In [1], in <cell line: 1>()
----> 1 import haystack

File ~/Documents/deepset/code/haystack/haystack/__init__.py:21, in <module>
     18 import pandas as pd
     20 from haystack.schema import Document, Answer, Label, MultiLabel, Span, EvaluationResult
---> 21 from haystack.nodes.base import BaseComponent
     22 from haystack.pipelines.base import Pipeline
     25 pd.options.display.max_colwidth = 80

File ~/Documents/deepset/code/haystack/haystack/nodes/__init__.py:1, in <module>
----> 1 from haystack.utils.import_utils import safe_import
      3 from haystack.nodes.base import BaseComponent
      5 from haystack.nodes.answer_generator import BaseGenerator, RAGenerator, Seq2SeqGenerator, OpenAIAnswerGenerator

File ~/Documents/deepset/code/haystack/haystack/utils/__init__.py:14, in <module>
      5 from haystack.utils.doc_store import (
      6     launch_es,
      7     launch_milvus,
   (...)
     11     stop_service,
     12 )
     13 from haystack.utils.deepsetcloud import DeepsetCloud, DeepsetCloudError, DeepsetCloudExperiments
---> 14 from haystack.utils.export_utils import (
     15     print_answers,
     16     print_documents,
     17     print_questions,
     18     export_answers_to_csv,
     19     convert_labels_to_squad,
     20 )
     21 from haystack.utils.squad_data import SquadData
     22 from haystack.utils.context_matching import calculate_context_similarity, match_context, match_contexts

File ~/Documents/deepset/code/haystack/haystack/utils/export_utils.py:11, in <module>
      8 import pandas as pd
     10 from haystack.schema import Document, Answer, SpeechAnswer
---> 11 from haystack.document_stores.sql import DocumentORM
     14 logger = logging.getLogger(__name__)
     17 def print_answers(results: dict, details: str = "all", max_text_len: Optional[int] = None):

File ~/Documents/deepset/code/haystack/haystack/document_stores/__init__.py:15, in <module>
     10 from haystack.document_stores.elasticsearch import ElasticsearchDocumentStore
     11 from haystack.document_stores.es_converter import (
     12     elasticsearch_index_to_document_store,
     13     open_search_index_to_document_store,
     14 )
---> 15 from haystack.document_stores.opensearch import OpenSearchDocumentStore, OpenDistroElasticsearchDocumentStore
     17 SQLDocumentStore = safe_import("haystack.document_stores.sql", "SQLDocumentStore", "sql")
     18 FAISSDocumentStore = safe_import("haystack.document_stores.faiss", "FAISSDocumentStore", "faiss")

File ~/Documents/deepset/code/haystack/haystack/document_stores/opensearch.py:15, in <module>
     12 except (ImportError, ModuleNotFoundError) as e:
     13     from haystack.utils.import_utils import _optional_component_not_installed
---> 15     _optional_component_not_installed(__name__, "opensearch", e)
     18 from haystack.schema import Document
     19 from haystack.document_stores.base import get_batches_from_generator

File ~/Documents/deepset/code/haystack/haystack/utils/import_utils.py:53, in _optional_component_not_installed(component, dep_group, source_error)
     52 def _optional_component_not_installed(component: str, dep_group: str, source_error: Exception):
---> 53     raise ImportError(
     54         f"Failed to import '{component}', "
     55         "which is an optional component in Haystack.\n"
     56         f"Run 'pip install 'farm-haystack[{dep_group}]'' "
     57         "to install the required dependencies and make this component available.\n"
     58         f"(Original error: {str(source_error)})"
     59     ) from source_error

ImportError: Failed to import 'haystack.document_stores.opensearch', which is an optional component in Haystack.
Run 'pip install 'farm-haystack[opensearch]'' to install the required dependencies and make this component available.
(Original error: No module named 'opensearchpy')

```

**Expected behavior**
For importing to work even with optional dependency not installed. 

**To Reproduce**
Create a new environment of haystack (at this commit e7627c3f8b241654b61f8523479c81f855102f0a) without `opensearch` installed and try `import haystack`. This error also appears in any of the tutorials run on Google Colab. 

**FAQ Check**
- [x] Have you had a look at [our new FAQ page](https://haystack.deepset.ai/overview/faq)?

**System:**
 - OS: MacOS
 - GPU/CPU: CPU
 - Haystack version (commit or version number): Master e7627c3f8b241654b61f8523479c81f855102f0a



Discussion:

Resolving patch:
diff --git a/haystack/document_stores/__init__.py b/haystack/document_stores/__init__.py
--- a/haystack/document_stores/__init__.py
+++ b/haystack/document_stores/__init__.py
@@ -12,8 +12,11 @@
     elasticsearch_index_to_document_store,
     open_search_index_to_document_store,
 )
-from haystack.document_stores.opensearch import OpenSearchDocumentStore, OpenDistroElasticsearchDocumentStore
 
+OpenSearchDocumentStore = safe_import("haystack.document_stores.opensearch", "OpenSearchDocumentStore", "opensearch")
+OpenDistroElasticsearchDocumentStore = safe_import(
+    "haystack.document_stores.opensearch", "OpenDistroElasticsearchDocumentStore", "opensearch"
+)
 SQLDocumentStore = safe_import("haystack.document_stores.sql", "SQLDocumentStore", "sql")
 FAISSDocumentStore = safe_import("haystack.document_stores.faiss", "FAISSDocumentStore", "faiss")
 PineconeDocumentStore = safe_import("haystack.document_stores.pinecone", "PineconeDocumentStore", "pinecone")


Test patch: