Skip to content

Commit

Permalink
fixing python black test
Browse files Browse the repository at this point in the history
Signed-off-by: deepanker13 <[email protected]>
  • Loading branch information
deepanker13 committed Apr 8, 2024
1 parent 7342ee5 commit 93db12d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions sdk/python/kubeflow/storage_initializer/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ def download_dataset(self):
aws_secret_access_key=self.config.secret_key,
region_name=self.config.region_name,
)
s3_resource = s3_client.resource('s3', endpoint_url=self.config.endpoint_url)
s3_resource = s3_client.resource("s3", endpoint_url=self.config.endpoint_url)
# Get the bucket object
bucket = s3_resource.Bucket(self.config.bucket_name)

# Filter objects with the specified prefix
objects = bucket.objects.filter(Prefix=self.config.file_key)
# Iterate over filtered objects
Expand All @@ -62,13 +62,11 @@ def download_dataset(self):

# Create directories if they don't exist
os.makedirs(
os.path.join(VOLUME_PATH_DATASET, path_excluded_first_last_parts), exist_ok=True
os.path.join(VOLUME_PATH_DATASET, path_excluded_first_last_parts),
exist_ok=True,
)

# Download the file
file_path = os.path.sep.join(path_components[1:])
bucket.download_file(
obj_key,
os.path.join(VOLUME_PATH_DATASET, file_path)
)
bucket.download_file(obj_key, os.path.join(VOLUME_PATH_DATASET, file_path))
print(f"Files downloaded")

0 comments on commit 93db12d

Please sign in to comment.