Skip to content

Commit

Permalink
(fix)[S3Bucket] fix download bucket object with prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
bmaisonneuve committed Oct 18, 2024
1 parent f93d326 commit 2f9844a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gws_core/impl/s3/s3_bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def get_object(self, object_key: str, local_file_path: str = None) -> str:

if local_file_path is None:
temp_dir = Settings.make_temp_dir()
local_file_path = f"{temp_dir}/{object_key}"
local_file_path = f"{temp_dir}/{FileHelper.get_name_with_extension(object_key)}"

upload_progress: S3BucketActionProgress = {
'transfered_bytes': 0,
Expand All @@ -114,7 +114,8 @@ def get_object(self, object_key: str, local_file_path: str = None) -> str:

bucket.download_file(self.bucket_name, object_key, local_file_path,
Callback=lambda chunk: self._upload_progress_callback(
chunk, total_size, start_time, upload_progress, 'Downloaded'))
chunk, total_size, start_time, upload_progress, 'Downloaded')
)

duration = DateHelper.get_duration_pretty_text(
time.time() - start_time)
Expand Down

0 comments on commit 2f9844a

Please sign in to comment.