Skip to content

Commit

Permalink
fix(datasets): fix datasets files put command (#363)
Browse files Browse the repository at this point in the history
The command was getting a presigned url without providing file name and would get 403'd
  • Loading branch information
Roger Lam committed Sep 9, 2021
1 parent f6bcbf7 commit 88464c1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gradient/commands/datasets.py
Expand Up @@ -560,7 +560,6 @@ class PutDatasetFilesCommand(BaseDatasetFilesCommand):
@classmethod
def _put(cls, path, url, content_type):
size = os.path.getsize(path)

with requests.Session() as session:
headers = {'Content-Type': content_type}

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

key = target_path
if not source_path_is_file:
if source_path_is_file:
key += source_name
else:
if not has_trailing_slash:
key += source_name + '/'
key += path[len(source_path)+1:]
Expand Down

0 comments on commit 88464c1

Please sign in to comment.