File tree 2 files changed +7
-4
lines changed 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -137,8 +137,8 @@ def delete_model(self):
137
137
def _get_model_names (self ):
138
138
endpoint_desc = self .sagemaker_session .sagemaker_client .describe_endpoint (EndpointName = self .endpoint )
139
139
endpoint_config_name = endpoint_desc ['EndpointConfigName' ]
140
- endpoint_config = self .sagemaker_session .sagemaker_client .describe_endpoint_config (EndpointConfigName =
141
- endpoint_config_name )
140
+ endpoint_config = self .sagemaker_session .sagemaker_client .describe_endpoint_config (
141
+ EndpointConfigName = endpoint_config_name )
142
142
production_variants = endpoint_config ['ProductionVariants' ]
143
143
return map (lambda d : d ['ModelName' ], production_variants )
144
144
Original file line number Diff line number Diff line change @@ -470,14 +470,17 @@ def test_delete_endpoint_only():
470
470
471
471
def test_delete_model ():
472
472
endpoint_desc = {
473
+ 'EndpointConfigName' : 'my-endpoint-config'
474
+ }
475
+ endpoint_config_desc = {
473
476
'ProductionVariants' : [{
474
- 'VariantName ' : 'my-model'
477
+ 'ModelName ' : 'my-model'
475
478
}]
476
479
}
477
480
sagemaker_session = empty_sagemaker_session ()
478
481
sagemaker_session .sagemaker_client .describe_endpoint = Mock (return_value = endpoint_desc )
482
+ sagemaker_session .sagemaker_client .describe_endpoint_config = Mock (return_value = endpoint_config_desc )
479
483
predictor = RealTimePredictor (ENDPOINT , sagemaker_session = sagemaker_session )
480
484
481
485
predictor .delete_model ()
482
486
sagemaker_session .delete_model .assert_called_with ('my-model' )
483
-
You can’t perform that action at this time.
0 commit comments