Skip to content

Commit cbf14cd

Browse files
[Hotfix Main]: fix(): Removed the blank line when downloading file. (#1749)
Co-authored-by: Ben <[email protected]>
1 parent 40d57d3 commit cbf14cd

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

flow360/cloud/s3_utils.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,8 @@ def download_file(
387387
Callback=progress_callback,
388388
)
389389
else:
390-
with _get_progress(_S3Action.DOWNLOADING) as progress:
391-
if verbose is True:
390+
if verbose is True:
391+
with _get_progress(_S3Action.DOWNLOADING) as progress:
392392
progress.start()
393393
task_id = progress.add_task(
394394
"download",
@@ -399,14 +399,18 @@ def download_file(
399399
def _call_back(bytes_in_chunk):
400400
progress.update(task_id, advance=bytes_in_chunk)
401401

402-
else:
403-
_call_back = None
404-
402+
client.download_file(
403+
Bucket=token.get_bucket(),
404+
Filename=to_file,
405+
Key=token.get_s3_key(),
406+
Callback=_call_back,
407+
)
408+
else:
405409
client.download_file(
406410
Bucket=token.get_bucket(),
407411
Filename=to_file,
408412
Key=token.get_s3_key(),
409-
Callback=_call_back,
413+
Callback=None,
410414
)
411415
if verbose is True:
412416
log.info(f"Saved to {to_file}")

0 commit comments

Comments
 (0)