@@ -662,7 +662,7 @@ def fetch_data_config(self):
662
662
"""Abstract method implementing retrieval of data config from a pre-configured data source.
663
663
664
664
Returns:
665
- object: The data configuration object for Example Notebooks
665
+ object: The data configuration object.
666
666
"""
667
667
668
668
@@ -695,7 +695,7 @@ def __init__(
695
695
self .sagemaker_session = sagemaker_session
696
696
697
697
def fetch_data_config (self ):
698
- """Fetches data configuration for Example Notebooks from a S3 bucket.
698
+ """Fetches data configuration from a S3 bucket.
699
699
700
700
Returns:
701
701
object: The JSON object containing data configuration.
@@ -704,20 +704,19 @@ def fetch_data_config(self):
704
704
json_string = self .sagemaker_session .read_s3_file (self .bucket_name , self .prefix )
705
705
return json .loads (json_string )
706
706
707
- def get_data_bucket (self ):
707
+ def get_data_bucket (self , region_requested = None ):
708
708
"""Provides the bucket containing the data for specified region.
709
709
710
+ Args:
711
+ region_requested (str): The region for which the data is beig requested.
712
+
710
713
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.
712
715
"""
713
716
714
717
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" ]
721
720
722
721
723
722
get_ecr_image_uri_prefix = deprecations .removed_function ("get_ecr_image_uri_prefix" )
0 commit comments