Skip to content

Commit 88464c1

Browse files
author
Roger Lam
authored
fix(datasets): fix datasets files put command (#363)
The command was getting a presigned url without providing file name and would get 403'd
1 parent f6bcbf7 commit 88464c1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

gradient/commands/datasets.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,6 @@ class PutDatasetFilesCommand(BaseDatasetFilesCommand):
560560
@classmethod
561561
def _put(cls, path, url, content_type):
562562
size = os.path.getsize(path)
563-
564563
with requests.Session() as session:
565564
headers = {'Content-Type': content_type}
566565

@@ -632,7 +631,9 @@ def update_status():
632631
path = path.replace(os.path.sep, '/')
633632

634633
key = target_path
635-
if not source_path_is_file:
634+
if source_path_is_file:
635+
key += source_name
636+
else:
636637
if not has_trailing_slash:
637638
key += source_name + '/'
638639
key += path[len(source_path)+1:]

0 commit comments

Comments
 (0)