diff --git a/Makefile b/Makefile index f344070..0396df5 100644 --- a/Makefile +++ b/Makefile @@ -83,7 +83,7 @@ mypy: check-safety: poetry check # TODO remove pip ignore flag when fixed - poetry run safety check --full-report -i 62044 -i 72809 -i 70612 + poetry run safety check --full-report -i 62044 -i 70612 poetry run bandit -ll --recursive domino_data tests .PHONY: lint diff --git a/domino_data/auth.py b/domino_data/auth.py index 222c441..f75c2a5 100644 --- a/domino_data/auth.py +++ b/domino_data/auth.py @@ -7,6 +7,7 @@ import attr import backoff import httpx +from httpx._config import DEFAULT_TIMEOUT_CONFIG from pyarrow import flight from datasource_api_client.client import Client @@ -26,7 +27,7 @@ def get_jwt_token(url: str) -> str: Raises: HTTPStatusError: if the API returns an error """ - resp = httpx.get(f"{url}/access-token") + resp = httpx.get(f"{url}/access-token", timeout=DEFAULT_TIMEOUT_CONFIG) resp.raise_for_status() return resp.read().decode("ascii") diff --git a/domino_data/data_sources.py b/domino_data/data_sources.py index 4556972..dc9058e 100644 --- a/domino_data/data_sources.py +++ b/domino_data/data_sources.py @@ -11,6 +11,7 @@ import httpx import pandas import urllib3 +from httpx._config import DEFAULT_TIMEOUT_CONFIG from pyarrow import ArrowException, flight, parquet import domino_data.configuration_gen @@ -348,11 +349,11 @@ def http(self) -> httpx.Client: DatasourceDtoDataSourceType.ADLSCONFIG.value, DatasourceDtoDataSourceType.AZUREBLOBSTORAGECONFIG.value, ): - self._httpx = httpx.Client(headers=ADLS_HEADERS, verify=context) + self._httpx = httpx.Client(headers=ADLS_HEADERS, verify=context, timeout=DEFAULT_TIMEOUT_CONFIG) elif self.datasource_type == DatasourceDtoDataSourceType.GENERICS3CONFIG.value: - self._httpx = httpx.Client(verify=False) # nosec + self._httpx = httpx.Client(verify=False, timeout=DEFAULT_TIMEOUT_CONFIG) # nosec else: - self._httpx = httpx.Client(verify=context) + self._httpx = httpx.Client(verify=context, timeout=DEFAULT_TIMEOUT_CONFIG) return self._httpx def pool_manager(self) -> urllib3.PoolManager: