Skip to content

Commit c6a2acb

Browse files
Fix batch deployment update bug (#37492) (#37746)
* fix batch deployment update bug * fix test
1 parent a560d4c commit c6a2acb

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/model_batch_deployment.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def __init__(
8585
self.compute = compute
8686
self.resources = resources
8787
if settings is not None:
88-
self.model_deployment_settings = ModelBatchDeploymentSettings(
88+
self.settings = ModelBatchDeploymentSettings(
8989
mini_batch_size=settings.mini_batch_size,
9090
instance_count=settings.instance_count,
9191
max_concurrency_per_instance=settings.max_concurrency_per_instance,
@@ -113,7 +113,7 @@ def _to_rest_object(self, location: str) -> BatchDeploymentData: # type: ignore
113113
if self.code_configuration
114114
else None
115115
)
116-
deployment_settings = self.model_deployment_settings
116+
deployment_settings = self.settings
117117
model = IdAssetReference(asset_id=self.model) if self.model else None
118118
batch_deployment = RestBatchDeployment(
119119
description=self.description,
@@ -188,9 +188,9 @@ def _validate(self) -> None:
188188

189189
def _validate_output_action(self) -> None:
190190
if (
191-
self.model_deployment_settings.output_action
192-
and self.model_deployment_settings.output_action == BatchDeploymentOutputAction.SUMMARY_ONLY
193-
and self.model_deployment_settings.output_file_name
191+
self.settings.output_action
192+
and self.settings.output_action == BatchDeploymentOutputAction.SUMMARY_ONLY
193+
and self.settings.output_file_name
194194
):
195195
msg = "When output_action is set to {}, the output_file_name need not to be specified."
196196
msg = msg.format(BatchDeploymentOutputAction.SUMMARY_ONLY)

sdk/ml/azure-ai-ml/tests/batch_services/unittests/test_model_batch_deployment_schema.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ def test_serialize_model_batch_deployment(self) -> None:
2929
assert mbd_entity
3030
assert mbd_entity.environment == "AzureML-sklearn-1.0-ubuntu20.04-py38-cpu:33"
3131
assert mbd_entity.compute == "cpu-cluster"
32-
assert mbd_entity.model_deployment_settings.output_action == BatchDeploymentOutputAction.APPEND_ROW
33-
assert mbd_entity.model_deployment_settings.output_file_name == "append_row.txt"
34-
assert mbd_entity.model_deployment_settings.error_threshold == 10
35-
assert mbd_entity.model_deployment_settings.mini_batch_size == 5
36-
assert mbd_entity.model_deployment_settings.max_concurrency_per_instance == 5
32+
assert mbd_entity.settings.output_action == BatchDeploymentOutputAction.APPEND_ROW
33+
assert mbd_entity.settings.output_file_name == "append_row.txt"
34+
assert mbd_entity.settings.error_threshold == 10
35+
assert mbd_entity.settings.mini_batch_size == 5
36+
assert mbd_entity.settings.max_concurrency_per_instance == 5
3737
assert mbd_entity.resources.instance_count == 2

0 commit comments

Comments
 (0)