From 28f4d44a6b4f687a53b61ffd576ea006fbbfa79c Mon Sep 17 00:00:00 2001 From: Daniel Garvey <34486624+dan-garvey@users.noreply.github.com> Date: Thu, 22 Jun 2023 20:30:27 -0500 Subject: [PATCH] downloader was double downloading (#1580) --- shark/shark_downloader.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/shark/shark_downloader.py b/shark/shark_downloader.py index 8005ecc120..73a8054955 100644 --- a/shark/shark_downloader.py +++ b/shark/shark_downloader.py @@ -60,12 +60,15 @@ def download_public_file( else: continue - destination_filename = os.path.join(destination_folder_name, blob_name) - if os.path.isdir(destination_filename): - continue - with open(destination_filename, "wb") as f: - with tqdm.wrapattr(f, "write", total=blob.size) as file_obj: - storage_client.download_blob_to_file(blob, file_obj) + else: + destination_filename = os.path.join( + destination_folder_name, blob_name + ) + if os.path.isdir(destination_filename): + continue + with open(destination_filename, "wb") as f: + with tqdm.wrapattr(f, "write", total=blob.size) as file_obj: + storage_client.download_blob_to_file(blob, file_obj) input_type_to_np_dtype = {