Skip to content

Commit 65337c2

Browse files
authored
Batch endpoint to october api (#33649)
1 parent 56e2476 commit 65337c2

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ def __init__(
542542
self._batch_deployments = BatchDeploymentOperations(
543543
self._operation_scope,
544544
self._operation_config,
545-
self._service_client_05_2022,
545+
self._service_client_10_2023,
546546
self._operation_container,
547547
credentials=self._credential,
548548
requests_pipeline=self._requests_pipeline,

sdk/ml/azure-ai-ml/azure/ai/ml/entities/_endpoint/batch_endpoint.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
from pathlib import Path
88
from typing import IO, Any, AnyStr, Dict, Optional, Union
99

10-
from azure.ai.ml._restclient.v2022_05_01.models import BatchEndpointData
11-
from azure.ai.ml._restclient.v2022_05_01.models import BatchEndpointDetails as RestBatchEndpoint
10+
from azure.ai.ml._restclient.v2023_10_01.models import BatchEndpoint as BatchEndpointData
11+
from azure.ai.ml._restclient.v2023_10_01.models import BatchEndpointProperties as RestBatchEndpoint
1212
from azure.ai.ml._schema._endpoint import BatchEndpointSchema
1313
from azure.ai.ml._utils.utils import camel_to_snake, snake_to_camel
1414
from azure.ai.ml.constants._common import AAD_TOKEN_YAML, BASE_PATH_CONTEXT_KEY, PARAMS_OVERRIDE_KEY

sdk/ml/azure-ai-ml/azure/ai/ml/operations/_batch_endpoint_operations.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from azure.ai.ml._azure_environments import _get_aml_resource_id_from_metadata, _resource_to_scopes
1818
from azure.ai.ml._exception_helper import log_and_raise_error
1919
from azure.ai.ml._restclient.v2020_09_01_dataplanepreview.models import BatchJobResource
20-
from azure.ai.ml._restclient.v2022_05_01 import AzureMachineLearningWorkspaces as ServiceClient052022
20+
from azure.ai.ml._restclient.v2023_10_01 import AzureMachineLearningServices as ServiceClient102023
2121
from azure.ai.ml._schema._deployment.batch.batch_job import BatchJobSchema
2222
from azure.ai.ml._scope_dependent_operations import (
2323
OperationConfig,
@@ -78,9 +78,9 @@ class BatchEndpointOperations(_ScopeDependentOperations):
7878
:type operation_scope: ~azure.ai.ml._scope_dependent_operations.OperationScope
7979
:param operation_config: Common configuration for operations classes of an MLClient object.
8080
:type operation_config: ~azure.ai.ml._scope_dependent_operations.OperationConfig
81-
:param service_client_05_2022: Service client to allow end users to operate on Azure Machine Learning Workspace
81+
:param service_client_10_2023: Service client to allow end users to operate on Azure Machine Learning Workspace
8282
resources.
83-
:type service_client_05_2022: ~azure.ai.ml._restclient.v2022_05_01._azure_machine_learning_workspaces.
83+
:type service_client_10_2023: ~azure.ai.ml._restclient.v2023_10_01._azure_machine_learning_workspaces.
8484
AzureMachineLearningWorkspaces
8585
:param all_operations: All operations classes of an MLClient object.
8686
:type all_operations: ~azure.ai.ml._scope_dependent_operations.OperationsContainer
@@ -92,15 +92,15 @@ def __init__(
9292
self,
9393
operation_scope: OperationScope,
9494
operation_config: OperationConfig,
95-
service_client_05_2022: ServiceClient052022,
95+
service_client_10_2023: ServiceClient102023,
9696
all_operations: OperationsContainer,
9797
credentials: Optional[TokenCredential] = None,
9898
**kwargs: Any,
9999
):
100100
super(BatchEndpointOperations, self).__init__(operation_scope, operation_config)
101101
ops_logger.update_info(kwargs)
102-
self._batch_operation = service_client_05_2022.batch_endpoints
103-
self._batch_deployment_operation = service_client_05_2022.batch_deployments
102+
self._batch_operation = service_client_10_2023.batch_endpoints
103+
self._batch_deployment_operation = service_client_10_2023.batch_deployments
104104
self._batch_job_endpoint = kwargs.pop("service_client_09_2020_dataplanepreview").batch_job_endpoint
105105
self._all_operations = all_operations
106106
self._credentials = credentials

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
from requests import Response
99

1010
from azure.ai.ml import load_batch_endpoint
11-
from azure.ai.ml._restclient.v2022_05_01.models import BatchEndpointData
12-
from azure.ai.ml._restclient.v2022_05_01.models import BatchEndpointDetails as RestBatchEndpoint
11+
from azure.ai.ml._restclient.v2023_10_01.models import BatchEndpoint as BatchEndpointData
12+
from azure.ai.ml._restclient.v2023_10_01.models import BatchEndpointProperties as RestBatchEndpoint
1313
from azure.ai.ml._scope_dependent_operations import OperationConfig, OperationScope
1414
from azure.ai.ml.constants._common import AssetTypes, AzureMLResourceType
1515
from azure.ai.ml.constants._endpoint import EndpointYamlFields
@@ -138,7 +138,7 @@ def mock_local_endpoint_helper() -> Mock:
138138
def mock_batch_endpoint_operations(
139139
mock_workspace_scope: OperationScope,
140140
mock_operation_config: OperationConfig,
141-
mock_aml_services_2022_05_01: Mock,
141+
mock_aml_services_2023_10_01: Mock,
142142
mock_aml_services_2020_09_01_dataplanepreview: Mock,
143143
mock_machinelearning_client: Mock,
144144
mock_environment_operations: Mock,
@@ -158,7 +158,7 @@ def mock_batch_endpoint_operations(
158158
yield BatchEndpointOperations(
159159
operation_scope=mock_workspace_scope,
160160
operation_config=mock_operation_config,
161-
service_client_05_2022=mock_aml_services_2022_05_01,
161+
service_client_10_2023=mock_aml_services_2023_10_01,
162162
all_operations=mock_machinelearning_client._operation_container,
163163
requests_pipeline=mock_machinelearning_client._requests_pipeline,
164164
**kwargs,
@@ -310,10 +310,10 @@ def test_list_deployment_jobs(
310310
def test_batch_get(
311311
self,
312312
mock_batch_endpoint_operations: BatchEndpointOperations,
313-
mock_aml_services_2022_05_01: Mock,
313+
mock_aml_services_2023_10_01: Mock,
314314
) -> None:
315315
random_name = "random_name"
316-
mock_aml_services_2022_05_01.batch_endpoints.get.return_value = BatchEndpointData(
316+
mock_aml_services_2023_10_01.batch_endpoints.get.return_value = BatchEndpointData(
317317
name=random_name,
318318
location="eastus",
319319
properties=RestBatchEndpoint(auth_mode="AADToken"),
@@ -324,11 +324,11 @@ def test_batch_get(
324324
def test_delete_batch_endpoint(
325325
self,
326326
mock_batch_endpoint_operations: BatchEndpointOperations,
327-
mock_aml_services_2022_05_01: Mock,
327+
mock_aml_services_2023_10_01: Mock,
328328
mocker: MockFixture,
329329
mock_delete_poller: LROPoller,
330330
) -> None:
331331
random_name = "random_name"
332-
mock_aml_services_2022_05_01.batch_endpoints.begin_delete.return_value = mock_delete_poller
332+
mock_aml_services_2023_10_01.batch_endpoints.begin_delete.return_value = mock_delete_poller
333333
mock_batch_endpoint_operations.begin_delete(name=random_name)
334334
mock_batch_endpoint_operations._batch_operation.begin_delete.assert_called_once()

0 commit comments

Comments
 (0)