Skip to content

Change allowed_instance_types to accept list instead of space-delimit…#46141

Merged
PratibhaShrivastav18 merged 6 commits intoAzure:mainfrom
PratibhaShrivastav18:shrivastavp/dt-allowed-instance-types-list
Apr 9, 2026
Merged

Change allowed_instance_types to accept list instead of space-delimit…#46141
PratibhaShrivastav18 merged 6 commits intoAzure:mainfrom
PratibhaShrivastav18:shrivastavp/dt-allowed-instance-types-list

Conversation

@PratibhaShrivastav18
Copy link
Copy Markdown
Member

@PratibhaShrivastav18 PratibhaShrivastav18 commented Apr 6, 2026

allowed_instance_types — Breaking Change

CLI (YAML input)

Before:

allowed_instance_types: Standard_DS3_v2 Standard_DS4_v2

After:

allowed_instance_types:
  - Standard_DS3_v2
  - Standard_DS4_v2

SDK

Before:

# str accepted
DeploymentTemplate(allowed_instance_types="Standard_DS3_v2 Standard_DS4_v2")

After:

# Only list accepted
DeploymentTemplate(allowed_instance_types=["Standard_DS3_v2", "Standard_DS4_v2"])

If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates allowed_instance_types to be represented as a YAML/SDK list (rather than a single space-delimited string), aligning schema + entity serialization with the service’s array shape.

Changes:

  • Updated DeploymentTemplateSchema to parse allowed_instance_types as List[str].
  • Updated DeploymentTemplate to type allowed_instance_types as Optional[List[str]] and to serialize it directly as allowedInstanceTypes.
  • Removed string-splitting conversion in DeploymentTemplateOperations._convert_dict_to_deployment_template, and updated one unit test to use a list.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
sdk/ml/azure-ai-ml/tests/deployment_template/unittests/test_deployment_template.py Updates initialization assertion to use list form for allowed_instance_types.
sdk/ml/azure-ai-ml/azure/ai/ml/operations/_deployment_template_operations.py Stops converting string allowed_instance_types into a list during dict-to-entity conversion.
sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/deployment_template.py Changes allowed_instance_types typing to List[str] and passes through list directly in REST serialization.
sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_deployment/template/deployment_template.py Changes marshmallow schema field type from Str to List(Str).

@PratibhaShrivastav18 PratibhaShrivastav18 force-pushed the shrivastavp/dt-allowed-instance-types-list branch from bfbd7cd to 31270ba Compare April 8, 2026 07:37
@PratibhaShrivastav18 PratibhaShrivastav18 force-pushed the shrivastavp/dt-allowed-instance-types-list branch from 31270ba to 80a5edd Compare April 8, 2026 07:50
@PratibhaShrivastav18 PratibhaShrivastav18 enabled auto-merge (squash) April 8, 2026 12:21
@PratibhaShrivastav18 PratibhaShrivastav18 merged commit efeb4d7 into Azure:main Apr 9, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants