Skip to content

Commit eb97ae1

Browse files
Correct API call for model archive in registry (#41502)
* fixing API call for model container archive for registry Model * fix broken test cases --------- Co-authored-by: Copilot <[email protected]>
1 parent 93ec31d commit eb97ae1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_asset_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ def _archive_or_restore(
10371037
)
10381038
container_resource.properties.is_archived = is_archived
10391039
( # pylint: disable=expression-not-assigned
1040-
container_operation.create_or_update(
1040+
container_operation.begin_create_or_update(
10411041
name=name,
10421042
resource_group_name=resource_group_name,
10431043
registry_name=registry_name,

sdk/ml/azure-ai-ml/tests/component/unittests/test_component_operations_registry.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
ComponentVersionDetails,
1111
)
1212
from azure.ai.ml._scope_dependent_operations import OperationConfig, OperationScope
13-
from azure.ai.ml.entities._component.command_component import CommandComponent
1413
from azure.ai.ml.entities._assets.intellectual_property import IntellectualProperty
14+
from azure.ai.ml.entities._component.command_component import CommandComponent
1515
from azure.ai.ml.operations import ComponentOperations
1616

1717
from .._util import _COMPONENT_TIMEOUT_SECOND
@@ -120,7 +120,7 @@ def test_archive_container(self, mock_component_operation: ComponentOperations):
120120
mock_component_operation._container_operation.get.return_value = component
121121
mock_component_operation.archive(name=name)
122122

123-
mock_component_operation._container_operation.create_or_update.assert_called_with(
123+
mock_component_operation._container_operation.begin_create_or_update.assert_called_with(
124124
name=name,
125125
registry_name=mock_component_operation._registry_name,
126126
body=component,
@@ -133,7 +133,7 @@ def test_restore_container(self, mock_component_operation: ComponentOperations):
133133
mock_component_operation._container_operation.get.return_value = component
134134
mock_component_operation.restore(name=name)
135135

136-
mock_component_operation._container_operation.create_or_update.assert_called_with(
136+
mock_component_operation._container_operation.begin_create_or_update.assert_called_with(
137137
name=name,
138138
registry_name=mock_component_operation._registry_name,
139139
body=component,

0 commit comments

Comments
 (0)