@@ -571,9 +571,9 @@ def download_fn(
571
571
572
572
async def download_from_url_multi_threaded (
573
573
file_handle_id : Optional [str ],
574
- object_id : Optional [str ],
575
- object_type : Optional [str ],
576
574
destination : str ,
575
+ object_id : Optional [str ] = None ,
576
+ object_type : Optional [str ] = None ,
577
577
* ,
578
578
expected_md5 : str = None ,
579
579
synapse_client : Optional ["Synapse" ] = None ,
@@ -584,12 +584,12 @@ async def download_from_url_multi_threaded(
584
584
585
585
Arguments:
586
586
file_handle_id: The id of the FileHandle to download
587
- object_id: The id of the Synapse object that uses the FileHandle
587
+ destination: The destination on local file system
588
+ object_id: Optional. The id of the Synapse object that uses the FileHandle
588
589
e.g. "syn123"
589
- object_type: The type of the Synapse object that uses the
590
+ object_type: Optional. The type of the Synapse object that uses the
590
591
FileHandle e.g. "FileEntity". Any of
591
592
<https://rest-docs.synapse.org/rest/org/sagebionetworks/repo/model/file/FileHandleAssociateType.html>
592
- destination: The destination on local file system
593
593
expected_md5: The expected MD5
594
594
content_size: The size of the content
595
595
synapse_client: If not passed in and caching was not disabled by
@@ -647,8 +647,8 @@ async def download_from_url_multi_threaded(
647
647
def download_from_url (
648
648
url : str ,
649
649
destination : str ,
650
- entity_id : Optional [str ],
651
- file_handle_associate_type : Optional [str ],
650
+ entity_id : Optional [str ] = None ,
651
+ file_handle_associate_type : Optional [str ] = None ,
652
652
file_handle_id : Optional [str ] = None ,
653
653
expected_md5 : Optional [str ] = None ,
654
654
progress_bar : Optional [tqdm ] = None ,
@@ -662,9 +662,9 @@ def download_from_url(
662
662
Arguments:
663
663
url: The source of download
664
664
destination: The destination on local file system
665
- entity_id: The id of the Synapse object that uses the FileHandle
665
+ entity_id: Optional. The id of the Synapse object that uses the FileHandle
666
666
e.g. "syn123"
667
- file_handle_associate_type: The type of the Synapse object that uses the
667
+ file_handle_associate_type: Optional. The type of the Synapse object that uses the
668
668
FileHandle e.g. "FileEntity". Any of
669
669
<https://rest-docs.synapse.org/rest/org/sagebionetworks/repo/model/file/FileHandleAssociateType.html>
670
670
file_handle_id: Optional. If given, the file will be given a temporary name that includes the file
@@ -694,7 +694,10 @@ def download_from_url(
694
694
actual_md5 = None
695
695
redirect_count = 0
696
696
delete_on_md5_mismatch = True
697
- client .logger .debug (f"[{ entity_id } ]: Downloading from { url } to { destination } " )
697
+ if entity_id is not None :
698
+ client .logger .debug (f"[{ entity_id } ]: Downloading from { url } to { destination } " )
699
+ else :
700
+ client .logger .debug (f"Downloading from { url } to { destination } " )
698
701
while redirect_count < REDIRECT_LIMIT :
699
702
redirect_count += 1
700
703
scheme = urllib_urlparse .urlparse (url ).scheme
0 commit comments