@@ -1064,7 +1064,7 @@ def _get_optimized_performance_parameters_for_upload(
10641064 def upload (
10651065 self ,
10661066 file_path : str ,
1067- content : BinaryIO ,
1067+ contents : BinaryIO ,
10681068 * ,
10691069 overwrite : Optional [bool ] = None ,
10701070 part_size : Optional [int ] = None ,
@@ -1076,7 +1076,7 @@ def upload(
10761076
10771077 :param file_path: str
10781078 The absolute remote path of the target file, e.g. /Volumes/path/to/your/file
1079- :param content : BinaryIO
1079+ :param contents : BinaryIO
10801080 The contents of the file to upload. This must be a BinaryIO stream.
10811081 :param overwrite: bool (optional)
10821082 If true, an existing file will be overwritten. When not specified, assumed True.
@@ -1096,7 +1096,7 @@ def upload(
10961096
10971097 if self ._config .disable_experimental_files_api_client :
10981098 _LOG .info ("Disable experimental files API client, will use the original upload method." )
1099- super ().upload (file_path = file_path , contents = content , overwrite = overwrite )
1099+ super ().upload (file_path = file_path , contents = contents , overwrite = overwrite )
11001100 return UploadStreamResult ()
11011101
11021102 _LOG .debug (f"Uploading file from BinaryIO stream" )
@@ -1107,12 +1107,12 @@ def upload(
11071107
11081108 # Determine content length if the stream is seekable
11091109 content_length = None
1110- if content .seekable ():
1110+ if contents .seekable ():
11111111 _LOG .debug (f"Uploading using seekable mode" )
11121112 # If the stream is seekable, we can read its size.
1113- content .seek (0 , os .SEEK_END )
1114- content_length = content .tell ()
1115- content .seek (0 )
1113+ contents .seek (0 , os .SEEK_END )
1114+ content_length = contents .tell ()
1115+ contents .seek (0 )
11161116
11171117 # Get optimized part size and batch size based on content length and provided part size
11181118 optimized_part_size , optimized_batch_size = self ._get_optimized_performance_parameters_for_upload (
@@ -1135,17 +1135,17 @@ def upload(
11351135 )
11361136
11371137 if ctx .use_parallel :
1138- self ._parallel_upload_from_stream (ctx , content )
1138+ self ._parallel_upload_from_stream (ctx , contents )
11391139 return UploadStreamResult ()
11401140 elif ctx .content_length is not None :
1141- self ._upload_single_thread_with_known_size (ctx , content )
1141+ self ._upload_single_thread_with_known_size (ctx , contents )
11421142 return UploadStreamResult ()
11431143 else :
11441144 _LOG .debug (f"Uploading using non-seekable mode" )
11451145 # If the stream is not seekable, we cannot determine its size.
11461146 # We will use a multipart upload.
11471147 _LOG .debug (f"Using multipart upload for non-seekable input stream of unknown size for file { file_path } " )
1148- self ._single_thread_multipart_upload (ctx , content )
1148+ self ._single_thread_multipart_upload (ctx , contents )
11491149 return UploadStreamResult ()
11501150
11511151 def upload_from (
0 commit comments