Migrate v2022_02_01_preview consumers to shared arm_ml_service client#47554
Open
saanikaguptamicrosoft wants to merge 3 commits into
Open
Migrate v2022_02_01_preview consumers to shared arm_ml_service client#47554saanikaguptamicrosoft wants to merge 3 commits into
saanikaguptamicrosoft wants to merge 3 commits into
Conversation
Reuse the existing arm_ml_service generated client for the v2022_02_01_preview
API surface instead of importing from the per-version restclient package, and
delete azure/ai/ml/_restclient/v2022_02_01_preview/ (76 files).
- _ml_client: wire the v2022_02_01_preview service client via a partial of
MachineLearningServicesMgmtClient with api_version='2022-02-01-preview'.
- Switch production imports (operations, entities, schema, utils) from
azure.ai.ml._restclient.v2022_02_01_preview to
azure.ai.ml._restclient.arm_ml_service and map the renamed hybrid models
(JobBaseData -> JobBase, BatchDeploymentData -> BatchDeployment,
OnlineEndpointData -> OnlineEndpoint,
OnlineEndpointDetails -> OnlineEndpointProperties).
- entities/_endpoint/online_endpoint.py: preserve the legacy 'endpoint' field
on the wire via dict-style assignment since the new hybrid
OnlineEndpointProperties model does not accept it as a constructor kwarg.
- entities/_util.py: normalize_job_input_output_type now uses hard-coded
camel-case keys ('Literal', 'UriFile', 'MlFlowModel', 'MlTable', ...) so it
no longer depends on the v2022 generated JobInputType enum. The
arm_ml_service JobInputType uses snake_case values and would silently break
the v2022_02_01_preview payload normalization path that
test_pipeline_component_entity / test_pipeline_job_entity exercise.
- Update affected unit tests to import from arm_ml_service.
- Delete the now-unused azure/ai/ml/_restclient/v2022_02_01_preview/ package.
The v2024_07_01_preview package had zero production consumers (datastore was consolidated onto 2024-10-01-preview earlier). The only remaining reference was an unused mock_aml_services_2024_07_01_preview conftest fixture; the equivalent mock_aml_services_2024_10_01_preview fixture already exists and points at the v2024_10_01_preview_tsp client. Delete the 76-file package and the stale fixture.
Reuse the existing arm_ml_service generated client for the v2025_01_01_preview
API surface instead of importing from the per-version restclient package, and
delete azure/ai/ml/_restclient/v2025_01_01_preview/.
- _ml_client: wire the v2025_01_01_preview service client via a partial of
MachineLearningServicesMgmtClient with api_version='2025-01-01-preview'.
- Switch production imports (command builder/entity, job_resource_configuration,
to_rest_functions, capability_host entity + operations) from
azure.ai.ml._restclient.v2025_01_01_preview to
azure.ai.ml._restclient.arm_ml_service.
- command_job.py: the shared CommandJob hybrid model does not declare
parent_job_name, but it is a real field on the 2025-01-01-preview wire
contract (wire key 'parentJobName'). Preserve it via dict-style assignment on
the rest model rather than passing it as a constructor kwarg, and read it back
via dict access in _load_from_rest.
- job_resource_configuration.py: same situation for max_instance_count
(wire key 'maxInstanceCount', still declared on v2023_04_01_preview). Set it on
the wire via dict assignment on the 202501 branch and read it back via
obj.get('maxInstanceCount') for the hybrid model. Verified the value survives
serialization and round-trip.
- Update conftest mock fixture and capability host entity test to import from
arm_ml_service.
- test_command_job_schema: environment_variables is Dict[str, str] on the REST
contract; the shared client coerces values to strings, so assert against the
stringified expected values.
- Delete the now-unused azure/ai/ml/_restclient/v2025_01_01_preview/ package.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reuse the existing arm_ml_service generated client for the v2022_02_01_preview API surface instead of importing from the per-version restclient package, and delete azure/ai/ml/_restclient/v2022_02_01_preview/ (76 files).
Description
Please add an informative description that covers that changes made by the pull request and link all relevant issues.
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:
General Guidelines and Best Practices
Testing Guidelines