Skip to content

Commit

Permalink
Merge pull request #13 from nextmv-io/merschformann/fix-large-result-…
Browse files Browse the repository at this point in the history
…download

Fixes downloading large results
  • Loading branch information
sebastian-quintero authored Feb 16, 2024
2 parents eb29f96 + 90a93b5 commit 9daf4d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions nextmv/cloud/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,13 +717,16 @@ def _run_result(
endpoint=f"{self.endpoint}/runs/{run_id}",
query_params=query_params,
)
result = RunResult.from_dict(response.json())
if not large_output:
return RunResult.from_dict(response.json())
return result

download_url = DownloadURL.from_dict(response.json())
response2 = self.client.request(
download_url = DownloadURL.from_dict(response.json()["output"])
download_response = self.client.request(
method="GET",
endpoint=download_url.url,
headers={"Content-Type": "application/json"},
)
result.output = download_response.json()

return RunResult.from_dict(response2.json())
return result
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Repository = "https://github.com/nextmv-io/nextmv-py"

[tool.ruff]
target-version = "py312"
select = [
lint.select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
Expand Down

0 comments on commit 9daf4d0

Please sign in to comment.