Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions simvue/api/objects/artifact/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,9 @@ def download_content(self) -> Generator[bytes]:
f"Could not retrieve URL for artifact '{self._identifier}'",
)

_timeout = BASE_TIMEOUT + DOWNLOAD_TIMEOUT_PER_MB * self.size / 1024 / 1024
_timeout: int = int(
BASE_TIMEOUT + DOWNLOAD_TIMEOUT_PER_MB * self.size / 1024 // 1024
)

self._logger.debug(
"Will wait %s for download of file %s of size %s",
Expand All @@ -425,12 +427,12 @@ def download_content(self) -> Generator[bytes]:
headers=None,
)

get_json_from_response(
response=_response,
allow_parse_failure=True,
expected_status=[http.HTTPStatus.OK],
scenario=f"Retrieval of file for {self.label()} '{self._identifier}'",
)
if _response.status_code != http.HTTPStatus.OK:
raise RuntimeError(
f"Retrieval of file date for {self.label()} '{self._identifier}' "
+ f"failed for url '{self.download_url}' "
+ f"with status code {_response.status_code}"
)

_total_length: str | None = _response.headers.get("content-length")

Expand Down
Loading