Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
augray committed Aug 29, 2024
1 parent 08814a0 commit 5cf2d3d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/airtrain/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ class AirtrainClient:
def __init__(
self, api_key: Optional[str] = None, base_url: Optional[str] = None
) -> None:
self._api_key: str = api_key or _find_api_key()
self._base_url: str = base_url or os.environ.get(
self._api_key: str = api_key or _find_api_key() # type: ignore
self._base_url: str = base_url or os.environ.get( # type: ignore
"AIRTRAIN_API_URL", _DEFAULT_BASE_URL
)
if self._base_url.endswith("/"):
Expand Down Expand Up @@ -147,7 +147,7 @@ def _put_bytes(
params=params,
follow_redirects=False,
)
if response.status_code not in (301, 302, 303, 307, 308):
if response.next_request is None:
logger.error("Response text:\n%s", response.text)
raise ServerError(f"Expected redirect but got: {response.status_code}")

Expand Down Expand Up @@ -204,7 +204,7 @@ def _handle_response(
raise ServerError("Malformed server response.")

if expect_json:
return response_json["data"]
return response_json["data"] # type: ignore
return None

def _full_url(self, url_path: str) -> str:
Expand Down

0 comments on commit 5cf2d3d

Please sign in to comment.