Skip to content

Commit 5b7e1b1

Browse files
Merge branch 'aws:master' into master
2 parents c9e563d + 9fc5755 commit 5b7e1b1

File tree

9 files changed

+47
-13
lines changed

9 files changed

+47
-13
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# Changelog
22

3+
## v2.50.0 (2021-07-28)
4+
5+
### Features
6+
7+
* add KIX region to image_uris
8+
9+
### Bug Fixes and Other Changes
10+
11+
* Rename `PredictorBase.delete_endpoint` as `PredictorBase.delete_predictor`
12+
* incorrect default argument for callback output parameter
13+
14+
### Documentation Changes
15+
16+
* Remove years from copyright boilerplate
17+
* Fix documentation formatting for PySpark and SparkJar processors
18+
19+
### Testing and Release Infrastructure
20+
21+
* enable py38 tox env
22+
323
## v2.49.2 (2021-07-21)
424

525
### Bug Fixes and Other Changes

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.49.3.dev0
1+
2.50.1.dev0

src/sagemaker/clarify.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,11 @@ def __init__(
305305
"""Initializes config for SHAP.
306306
307307
Args:
308-
baseline (str or list): A list of rows (at least one) or S3 object URI to be used as
309-
the baseline dataset in the Kernel SHAP algorithm. The format should be the same
310-
as the dataset format. Each row should contain only the feature columns/values
311-
and omit the label column/values.
308+
baseline (None or str or list): None or S3 object Uri or A list of rows (at least one)
309+
to be used asthe baseline dataset in the Kernel SHAP algorithm. The format should
310+
be the same as the dataset format. Each row should contain only the feature
311+
columns/values and omit the label column/values. If None a baseline will be
312+
calculated automatically by using K-means or K-prototypes in the input dataset.
312313
num_samples (int): Number of samples to be used in the Kernel SHAP algorithm.
313314
This number determines the size of the generated synthetic dataset to compute the
314315
SHAP values.

src/sagemaker/estimator.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2319,9 +2319,13 @@ def _model_source_dir(self):
23192319
str: Either a local or an S3 path pointing to the ``source_dir`` to be
23202320
used for code by the model to be deployed
23212321
"""
2322-
return (
2323-
self.source_dir if self.sagemaker_session.local_mode else self.uploaded_code.s3_prefix
2324-
)
2322+
if self.sagemaker_session.local_mode:
2323+
return self.source_dir
2324+
2325+
if self.uploaded_code is not None:
2326+
return self.uploaded_code.s3_prefix
2327+
2328+
return None
23252329

23262330
def _model_entry_point(self):
23272331
"""Get the appropriate value to pass as ``entry_point`` to a model constructor.
@@ -2333,7 +2337,10 @@ def _model_entry_point(self):
23332337
if self.sagemaker_session.local_mode or (self._model_source_dir() is None):
23342338
return self.entry_point
23352339

2336-
return self.uploaded_code.script_name
2340+
if self.uploaded_code is not None:
2341+
return self.uploaded_code.script_name
2342+
2343+
return None
23372344

23382345
def hyperparameters(self):
23392346
"""Return the hyperparameters as a dictionary to use for training.

src/sagemaker/predictor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def predict(self, *args, **kwargs) -> Any:
6262
"""Perform inference on the provided data and return a prediction."""
6363

6464
@abc.abstractmethod
65-
def delete_endpoint(self, *args, **kwargs) -> None:
65+
def delete_predictor(self, *args, **kwargs) -> None:
6666
"""Destroy resources associated with this predictor."""
6767

6868
@property
@@ -330,6 +330,8 @@ def delete_endpoint(self, delete_endpoint_config=True):
330330

331331
self.sagemaker_session.delete_endpoint(self.endpoint_name)
332332

333+
delete_predictor = delete_endpoint
334+
333335
def delete_model(self):
334336
"""Deletes the Amazon SageMaker models backing this predictor."""
335337
request_failed = False

src/sagemaker/serverless/predictor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def predict(self, data: dict) -> dict:
6161
response["ResponseMetadata"]["HTTPHeaders"]["content-type"],
6262
)
6363

64-
def delete_endpoint(self) -> None:
64+
def delete_predictor(self) -> None:
6565
"""Destroy the Lambda function specified in the constructor."""
6666
self._client.delete_function(FunctionName=self._function_name)
6767

src/sagemaker/workflow/_utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,9 @@ def arguments(self) -> RequestType:
312312
model = self.estimator.create_model(**self.kwargs)
313313
self.image_uri = model.image_uri
314314

315+
if self.model_data is None:
316+
self.model_data = model.model_data
317+
315318
# reset placeholder
316319
self.estimator.output_path = output_path
317320

src/sagemaker/workflow/step_collections.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def __init__(
146146
else:
147147
sagemaker_session = model_entity.sagemaker_session
148148
role = model_entity.role
149-
if hasattr(model_entity, "entry_point"):
149+
if hasattr(model_entity, "entry_point") and model_entity.entry_point is not None:
150150
repack_model = True
151151
entry_point = model_entity.entry_point
152152
source_dir = model_entity.source_dir
@@ -169,6 +169,7 @@ def __init__(
169169
model_entity.model_data = (
170170
repack_model_step.properties.ModelArtifacts.S3ModelArtifacts
171171
)
172+
172173
# remove kwargs consumed by model repacking step
173174
kwargs.pop("output_kms_key", None)
174175

tests/unit/sagemaker/serverless/test_predictor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def test_predict(mock_client):
4848
def test_delete_endpoint(mock_client):
4949
predictor = LambdaPredictor(FUNCTION_NAME, client=mock_client)
5050

51-
predictor.delete_endpoint()
51+
predictor.delete_predictor()
5252

5353
mock_client.delete_function.assert_called_once()
5454
_, kwargs = mock_client.delete_function.call_args

0 commit comments

Comments
 (0)