Skip to content

Commit

Permalink
adding validations
Browse files Browse the repository at this point in the history
  • Loading branch information
deepanker13 committed Dec 13, 2023
1 parent 326763e commit 8cf66cd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sdk/python/kubeflow/storage_init_container/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ def is_valid_url(self, url):

def __post_init__(self):
# Custom checks or validations can be added here
if (
self.bucket_name is None
or self.endpoint_url is None
or self.file_key is None
):
raise ValueError("bucket_name or endpoint_url or file_key is None")
self.is_valid_url(self.endpoint_url)


Expand All @@ -39,7 +45,7 @@ def download_dataset(self):
aws_access_key_id=self.config.access_key,
aws_secret_access_key=self.config.secret_key,
endpoint_url=self.config.endpoint_url,
region_name=self.config.egion_name,
region_name=self.config.region_name,
)

# Download the file
Expand Down

0 comments on commit 8cf66cd

Please sign in to comment.