Skip to content

do not call create bucket if data location is provided #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/sagemaker/amazon/amazon_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def __init__(self, role, train_instance_count, train_instance_type, data_locatio
super(AmazonAlgorithmEstimatorBase, self).__init__(role, train_instance_count, train_instance_type,
**kwargs)

default_location = "s3://{}/sagemaker-record-sets/".format(self.sagemaker_session.default_bucket())
data_location = data_location or default_location
data_location = data_location or "s3://{}/sagemaker-record-sets/".format(
self.sagemaker_session.default_bucket())
self.data_location = data_location

def train_image(self):
Expand Down
7 changes: 7 additions & 0 deletions tests/unit/test_amazon_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ def test_data_location_validation(sagemaker_session):
pca.data_location = "nots3://abcd/efgh"


def test_data_location_does_not_call_default_bucket(sagemaker_session):
data_location = "s3://my-bucket/path/"
pca = PCA(num_components=2, sagemaker_session=sagemaker_session, data_location=data_location, **COMMON_ARGS)
assert pca.data_location == data_location
assert not sagemaker_session.default_bucket.called


def test_pca_hyperparameters(sagemaker_session):
pca = PCA(num_components=55, algorithm_mode='randomized',
subtract_mean=True, extra_components=33, sagemaker_session=sagemaker_session,
Expand Down