Skip to content

Commit

Permalink
Fixed the safety check error
Browse files Browse the repository at this point in the history
  • Loading branch information
ddl-joyce-zhao committed Nov 4, 2024
1 parent a02a41e commit c5a6f91
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion domino_data/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")

Expand Down
7 changes: 4 additions & 3 deletions domino_data/data_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit c5a6f91

Please sign in to comment.