Skip to content

Commit 2bc1761

Browse files
committed
Closes UNB-2443 [CLIENT] Model and dataset uploads are broken to AWS
1 parent 03465be commit 2bc1761

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1010
# Fixed
1111

1212
* Fixed link to project page when loading / creating a project.
13+
* Presigned url endpoint when using AWS / GCP / Azure.
1314

1415
# Changed
1516

unboxapi/api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def upload_blob_s3(
155155
in the backend.
156156
"""
157157
params = {"storageInterface": "s3", "objectName": object_name}
158-
presigned_json = self.get_request(endpoint, params=params)
158+
presigned_json = self.get_request(f"{endpoint}/presigned-url", params=params)
159159
with open(file_path, "rb") as f:
160160
with tqdm(
161161
total=os.stat(file_path).st_size,
@@ -181,7 +181,7 @@ def upload_blob_gcs(
181181
in the backend.
182182
"""
183183
params = {"storageInterface": "gcs", "objectName": object_name}
184-
presigned_json = self.get_request(endpoint, params=params)
184+
presigned_json = self.get_request(f"{endpoint}/presigned-url", params=params)
185185
with open(file_path, "rb") as f:
186186
with tqdm(
187187
total=os.stat(file_path).st_size,
@@ -208,7 +208,7 @@ def upload_blob_azure(
208208
in the backend.
209209
"""
210210
params = {"storageInterface": "azure", "objectName": object_name}
211-
presigned_json = self.get_request(endpoint, params=params)
211+
presigned_json = self.get_request(f"{endpoint}/presigned-url", params=params)
212212
with open(file_path, "rb") as f:
213213
with tqdm(
214214
total=os.stat(file_path).st_size,
@@ -239,7 +239,7 @@ def transfer_blob(self, endpoint: str, file_path: str, object_name: str, body=No
239239
blob_path = f"{UNBOX_STORAGE_PATH}/{endpoint}/{id}"
240240
try:
241241
os.makedirs(blob_path, exist_ok=True)
242-
except OSError as _:
242+
except OSError:
243243
raise UnboxException(f"Directory {blob_path} cannot be created")
244244
shutil.copyfile(file_path, f"{blob_path}/{object_name}")
245245
body["storageUri"] = f"local://{blob_path}"

0 commit comments

Comments
 (0)