@@ -723,15 +723,6 @@ def download(self, file_path: str) -> DownloadResponse:
723723 initial_response .contents ._response = wrapped_response
724724 return initial_response
725725
726- def _download_raw_stream (
727- self ,
728- file_path : str ,
729- start_byte_offset : int ,
730- if_unmodified_since_timestamp : Optional [str ] = None ,
731- ) -> DownloadResponse :
732- headers = {
733- "Accept" : "application/octet-stream" ,
734- }
735726
736727 def upload (self , file_path : str , contents : BinaryIO , * , overwrite : Optional [bool ] = None ):
737728 # Upload empty and small files with one-shot upload.
@@ -885,6 +876,8 @@ def perform():
885876
886877 # following _BaseClient timeout
887878 retry_timeout_seconds = self ._config .retry_timeout_seconds or 300
879+
880+ # Uploading same data to the same URL is an idempotent operation, safe to retry.
888881 upload_response = retried (
889882 timeout = timedelta (seconds = retry_timeout_seconds ),
890883 is_retryable = _BaseClient ._is_retryable ,
@@ -1219,6 +1212,8 @@ def perform():
12191212
12201213 # following _BaseClient timeout
12211214 retry_timeout_seconds = self ._config .retry_timeout_seconds or 300
1215+
1216+ # Aborting upload is an idempotent operation, safe to retry.
12221217 abort_response = retried (
12231218 timeout = timedelta (seconds = retry_timeout_seconds ), is_retryable = _BaseClient ._is_retryable , clock = self ._clock
12241219 )(perform )()
@@ -1245,6 +1240,7 @@ def perform():
12451240
12461241 # following _BaseClient timeout
12471242 retry_timeout_seconds = self ._config .retry_timeout_seconds or 300
1243+ # Aborting upload is an idempotent operation, safe to retry.
12481244 abort_response = retried (
12491245 timeout = timedelta (seconds = retry_timeout_seconds ), is_retryable = _BaseClient ._is_retryable , clock = self ._clock
12501246 )(perform )()
0 commit comments