Skip to content

Commit

Permalink
chore: remove warning suppression in library and use tqdm.auto import
Browse files Browse the repository at this point in the history
Signed-off-by: Michele Dolfi <[email protected]>
  • Loading branch information
dolfim-ibm committed Feb 21, 2024
1 parent 032aad2 commit 913e9e4
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 25 deletions.
2 changes: 1 addition & 1 deletion deepsearch/artifacts/artifact_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import platformdirs
import requests
from tqdm import tqdm
from tqdm.auto import tqdm

DFLT_ARTFCT_INDEX_DIR = os.getenv("DEEPSEARCH_ARTIFACT_INDEX", default=os.getcwd())
DFLT_ARTFCT_CACHE_DIR = os.getenv(
Expand Down
5 changes: 1 addition & 4 deletions deepsearch/cps/data_indices/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
from pathlib import Path
from typing import Any, Dict, List, Optional, Union

import urllib3

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
from tqdm import tqdm
from tqdm.auto import tqdm

from deepsearch.cps.client.api import CpsApi
from deepsearch.cps.client.components.data_indices import S3Coordinates
Expand Down
4 changes: 1 addition & 3 deletions deepsearch/documents/core/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
from typing import Any, List, Optional

import requests
import urllib3
from tqdm import tqdm
from tqdm.auto import tqdm

from deepsearch.cps.apis import public as sw_client
from deepsearch.cps.apis.public.models.temporary_upload_file_result import (
Expand All @@ -19,7 +18,6 @@
from .models import ConversionSettings, ExportTarget, ZipTarget
from .utils import URLNavigator, collect_all_local_files, download_url

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
logger = logging.getLogger(__name__)


Expand Down
2 changes: 1 addition & 1 deletion deepsearch/documents/core/create_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import Any, List, Union

import requests
from tqdm import tqdm
from tqdm.auto import tqdm

from deepsearch.core.util.ccs_utils import get_ccs_project_key
from deepsearch.cps.client.api import CpsApi
Expand Down
9 changes: 2 additions & 7 deletions deepsearch/documents/core/input_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,17 @@
from pathlib import Path
from typing import List, Optional

import urllib3

from deepsearch.cps.client.api import CpsApi
from deepsearch.documents.core.results import DocumentConversionResult

from .models import ConversionSettings, ExportTarget, S3Coordinates
from .utils import batch_single_files

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

from .convert import (
check_status_running_tasks,
send_files_for_conversion,
send_urls_for_conversion,
submit_conversion_payload,
)
from .models import ConversionSettings, ExportTarget, S3Coordinates
from .utils import batch_single_files


def process_local_input(
Expand Down
4 changes: 0 additions & 4 deletions deepsearch/documents/core/main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from pathlib import Path
from typing import List, Optional, Union

import urllib3

from deepsearch.cps.client.api import CpsApi
from deepsearch.documents.core.input_process import (
process_cos_input,
Expand All @@ -15,8 +13,6 @@
S3Coordinates,
)

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)


def convert_documents(
proj_key: str,
Expand Down
4 changes: 0 additions & 4 deletions deepsearch/documents/core/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
from pathlib import Path
from typing import Any, List, Optional, Union

import urllib3

from deepsearch.cps.client.api import CpsApi
from deepsearch.documents.core.convert import (
download_converted_documents,
Expand All @@ -12,8 +10,6 @@
from deepsearch.documents.core.create_report import get_multiple_reports
from deepsearch.documents.core.models import S3Coordinates

urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)


class DocumentConversionResult:
"""
Expand Down
2 changes: 1 addition & 1 deletion deepsearch/documents/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import requests
from pydantic.v1 import BaseModel
from tqdm import tqdm
from tqdm.auto import tqdm

from deepsearch.cps.client.api import CpsApi

Expand Down

0 comments on commit 913e9e4

Please sign in to comment.