Skip to content

Commit 030caa7

Browse files
committed
Update doctsrings to match
1 parent db697db commit 030caa7

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/sagemaker/utils.py

+9-10
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ def fetch_data_config(self):
662662
"""Abstract method implementing retrieval of data config from a pre-configured data source.
663663
664664
Returns:
665-
object: The data configuration object for Example Notebooks
665+
object: The data configuration object.
666666
"""
667667

668668

@@ -695,7 +695,7 @@ def __init__(
695695
self.sagemaker_session = sagemaker_session
696696

697697
def fetch_data_config(self):
698-
"""Fetches data configuration for Example Notebooks from a S3 bucket.
698+
"""Fetches data configuration from a S3 bucket.
699699
700700
Returns:
701701
object: The JSON object containing data configuration.
@@ -704,20 +704,19 @@ def fetch_data_config(self):
704704
json_string = self.sagemaker_session.read_s3_file(self.bucket_name, self.prefix)
705705
return json.loads(json_string)
706706

707-
def get_data_bucket(self):
707+
def get_data_bucket(self, region_requested=None):
708708
"""Provides the bucket containing the data for specified region.
709709
710+
Args:
711+
region_requested (str): The region for which the data is beig requested.
712+
710713
Returns:
711-
str: The S3 bucket containing datasets for Example Notebooks in the specified region.
714+
str: Name of the S3 bucket containing datasets in the requested region.
712715
"""
713716

714717
config = self.fetch_data_config()
715-
region = self.sagemaker_session.boto_region_name
716-
return (
717-
config[self.sagemaker_session.boto_region_name]
718-
if region in config.keys()
719-
else config["default"]
720-
)
718+
region = region_requested if region_requested else self.sagemaker_session.boto_region_name
719+
return config[region] if region in config.keys() else config["default"]
721720

722721

723722
get_ecr_image_uri_prefix = deprecations.removed_function("get_ecr_image_uri_prefix")

0 commit comments

Comments
 (0)