3030
3131from .structs import RetryResponse , UrlAndHeaders
3232
33- __all__ = [
34- "DownloadClient" ,
35- "extract_download_url" ,
36- "extract_file_size" ,
37- ]
33+ __all__ = ["DownloadClient" , "extract_download_url" ]
3834
3935DrsObject = dict [str , Any ]
4036
@@ -280,8 +276,6 @@ def _handle_drs_object_response(
280276 file_id = url .rsplit ("/" , 1 )[1 ]
281277 raise exceptions .FileNotRegisteredError (file_id = file_id )
282278 case _:
283- # this includes 404 because the file's existence should be verified
284- # earlier when getting the file envelope
285279 raise exceptions .BadResponseCodeError (url = url , response_code = status_code )
286280
287281
@@ -296,16 +290,3 @@ def extract_download_url(drs_object: DrsObject) -> str:
296290 if access_method ["type" ] == "s3" :
297291 return access_method ["access_url" ]["url" ]
298292 raise exceptions .NoS3AccessMethodError (file_id = drs_object ["id" ])
299-
300-
301- def extract_file_size (drs_object : DrsObject ) -> int :
302- """Extract the file size from a DRS Object
303-
304- Raises:
305- NoS3AccessMethodError: If the DRS object doesn't have an S3 access method.
306- """
307- access_methods = drs_object ["access_methods" ]
308- for access_method in access_methods :
309- if access_method ["type" ] == "s3" :
310- return drs_object ["size" ]
311- raise exceptions .NoS3AccessMethodError (file_id = drs_object ["id" ])
0 commit comments