Skip to content

Commit 55cf461

Browse files
authored
pipeline component deployment description fix (Azure#33071)
* pipeline component deployment description fix * pylint
1 parent 3ff31f9 commit 55cf461

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_deployment/batch/pipeline_component_batch_deployment_schema.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import logging
77
from typing import Any
88

9-
from marshmallow import ValidationError, INCLUDE, fields, post_load, validates
9+
from marshmallow import INCLUDE, fields, post_load
1010

1111
from azure.ai.ml._schema import (
1212
ArmVersionedStr,
@@ -45,11 +45,6 @@ class PipelineComponentBatchDeploymentSchema(PathAwareSchema):
4545
tags = fields.Dict()
4646
description = fields.Str(metadata={"description": "Description of the endpoint deployment."})
4747

48-
@validates("description")
49-
def validate_user_assigned_identities(self, data):
50-
if len(data) > 0:
51-
raise ValidationError("Parameter 'Description' is not allowed for deployment type 'Pipeline'.")
52-
5348
@post_load
5449
def make(self, data: Any, **kwargs: Any) -> Any: # pylint: disable=unused-argument
5550
from azure.ai.ml.entities._deployment.pipeline_component_batch_deployment import (

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ class PipelineComponentBatchDeployment(Resource):
3434
:type type: Optional[str]
3535
:param name: Name of the deployment resource.
3636
:type name: Optional[str]
37+
:param description: Description of the deployment resource.
38+
:type description: Optional[str]
3739
:param component: Component definition.
3840
:type component: Optional[Union[Component, str]]
3941
:param settings: Run-time settings for the pipeline job.
@@ -55,10 +57,11 @@ def __init__(
5557
settings: Optional[Dict[str, str]] = None,
5658
job_definition: Optional[Dict[str, BaseNode]] = None,
5759
tags: Optional[Dict] = None,
60+
description: Optional[str] = None,
5861
**kwargs, # pylint: disable=unused-argument
5962
):
6063
self._type = kwargs.pop("type", None)
61-
super().__init__(name=name, tags=tags, **kwargs)
64+
super().__init__(name=name, tags=tags, description=description, **kwargs)
6265
self.component = component
6366
self.endpoint_name = endpoint_name
6467
self.settings = settings
@@ -82,7 +85,10 @@ def _to_rest_object(self, location: str) -> "RestBatchDeployment": # pylint: di
8285
return RestBatchDeployment(
8386
location=location,
8487
tags=self.tags,
85-
properties=BatchDeploymentProperties(deployment_configuration=batch_pipeline_config),
88+
properties=BatchDeploymentProperties(
89+
deployment_configuration=batch_pipeline_config,
90+
description=self.description,
91+
),
8692
)
8793

8894
@classmethod

0 commit comments

Comments
 (0)