@@ -143,7 +143,9 @@ def put_request(self, endpoint: str, body=None, files=None, data=None):
143
143
data = data ,
144
144
)
145
145
146
- def upload_blob_s3 (self , endpoint : str , file_path : str , body = None ):
146
+ def upload_blob_s3 (
147
+ self , endpoint : str , file_path : str , object_name : str , body = None
148
+ ):
147
149
"""Generic method to upload data to S3 storage and create the appropriate resource
148
150
in the backend.
149
151
"""
@@ -189,7 +191,7 @@ def upload_blob_gcs(self, endpoint: str, file_path: str, body=None):
189
191
else :
190
192
self ._raise_on_respose (res )
191
193
192
- def transfer_blob (self , endpoint : str , file_path : str , body = None ):
194
+ def transfer_blob (self , endpoint : str , file_path : str , object_name : str , body = None ):
193
195
"""Generic method to transfer data to the unbox folder and create the appropriate
194
196
resource in the backend when using a local deployment.
195
197
"""
@@ -199,6 +201,6 @@ def transfer_blob(self, endpoint: str, file_path: str, body=None):
199
201
os .makedirs (blob_path , exist_ok = True )
200
202
except OSError as _ :
201
203
raise UnboxException (f"Directory { blob_path } cannot be created" )
202
- shutil .copyfile (file_path , f"{ blob_path } /{ id } " )
203
- body ["storagePath" ] = f"local://{ blob_path } / { id } "
204
+ shutil .copyfile (file_path , f"{ blob_path } /{ object_name } " )
205
+ body ["storagePath" ] = f"local://{ blob_path } "
204
206
return self .post_request (f"{ endpoint } /{ id } " , body = body )
0 commit comments