Skip to content

Commit

Permalink
updated import error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Hasala Marakkalage committed Jul 12, 2023
1 parent 5810ef6 commit fe3a07a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
14 changes: 9 additions & 5 deletions dsp/modules/azurecognitivesearch.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
from typing import Optional, Union, Any

from dsp.utils import dotdict

from azure.core.credentials import AzureKeyCredential
from azure.search.documents import SearchClient
from azure.search.documents._paging import SearchItemPaged

try:
from azure.core.credentials import AzureKeyCredential
from azure.search.documents import SearchClient
from azure.search.documents._paging import SearchItemPaged
except ImportError as e:
raise ImportError(
"You need to install azure-search-documents library"
"Please use the command: pip install azure-search-documents"
)

class AzureCognitiveSearch:
"""Wrapper for the Azure Congitive Search Retrieval."""
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
"regex",
"ujson",
"tqdm",
"datasets",
'azure-search-documents'
"datasets",
],
classifiers=[
"Development Status :: 3 - Alpha",
Expand Down

0 comments on commit fe3a07a

Please sign in to comment.