Skip to content

Commit 557f1b2

Browse files
authored
fix(storage): reconstruct path back instead of returning a tuple (#1267)
1 parent df911cb commit 557f1b2

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/storage/src/storage3/_async/file_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ async def upload_to_signed_url(
180180
)
181181
data: UploadData = response.json()
182182

183-
return UploadResponse(path=path, Key=data.get("Key"))
183+
return UploadResponse(path=path, Key=data["Key"])
184184

185185
def _make_signed_url(
186186
self, signed_url: str, download_query: dict[str, str]
@@ -520,7 +520,7 @@ async def _upload_or_update(
520520

521521
data: UploadData = response.json()
522522

523-
return UploadResponse(path=path, Key=data.get("Key"))
523+
return UploadResponse(path="/".join(path), Key=data["Key"])
524524

525525
async def upload(
526526
self,

src/storage/src/storage3/_sync/file_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def upload_to_signed_url(
180180
)
181181
data: UploadData = response.json()
182182

183-
return UploadResponse(path=path, Key=data.get("Key"))
183+
return UploadResponse(path=path, Key=data["Key"])
184184

185185
def _make_signed_url(
186186
self, signed_url: str, download_query: dict[str, str]
@@ -520,7 +520,7 @@ def _upload_or_update(
520520

521521
data: UploadData = response.json()
522522

523-
return UploadResponse(path=path, Key=data.get("Key"))
523+
return UploadResponse(path="/".join(path), Key=data["Key"])
524524

525525
def upload(
526526
self,

src/storage/src/storage3/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class UploadResponse:
104104
full_path: str
105105
fullPath: str
106106

107-
def __init__(self, path, Key):
107+
def __init__(self, path: str, Key: str):
108108
self.path = path
109109
self.full_path = Key
110110
self.fullPath = Key

0 commit comments

Comments
 (0)