Skip to content

Commit 0e53f3e

Browse files
committed
Merge branch 'release/azure-ai-ml/1.16.0' of https://github.com/Azure/azure-sdk-for-python into release/azure-ai-ml/1.16.0
2 parents c7f0c13 + a87a5f5 commit 0e53f3e

File tree

4 files changed

+21
-18
lines changed

4 files changed

+21
-18
lines changed

sdk/ml/azure-ai-ml/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "python",
44
"TagPrefix": "python/ml/azure-ai-ml",
5-
"Tag": "python/ml/azure-ai-ml_bcde27db64"
5+
"Tag": "python/ml/azure-ai-ml_a71be27649"
66
}

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ class EvaluatorOperations(_ScopeDependentOperations):
6363
:type datastore_operations: ~azure.ai.ml.operations._datastore_operations.DatastoreOperations
6464
:param all_operations: All operations classes of an MLClient object.
6565
:type all_operations: ~azure.ai.ml._scope_dependent_operations.OperationsContainer
66+
:param kwargs: A dictionary of additional configuration parameters.
67+
:type kwargs: dict
6668
"""
6769

6870
# pylint: disable=unused-argument
@@ -92,7 +94,7 @@ def __init__(
9294

9395
@monitor_with_activity(ops_logger, "Evaluator.CreateOrUpdate", ActivityType.PUBLICAPI)
9496
def create_or_update( # type: ignore
95-
self, model: Union[Model, WorkspaceAssetReference]
97+
self, model: Union[Model, WorkspaceAssetReference], **kwargs: Any
9698
) -> Model: # TODO: Are we going to implement job_name?
9799
"""Returns created or updated model asset.
98100
@@ -125,15 +127,15 @@ def _raise_if_not_evaluator(self, properties: Optional[Dict[str, Any]], message:
125127
)
126128

127129
@monitor_with_activity(ops_logger, "Evaluator.Get", ActivityType.PUBLICAPI)
128-
def get(self, name: str, version: Optional[str] = None, label: Optional[str] = None) -> Model:
130+
def get(self, name: str, *, version: Optional[str] = None, label: Optional[str] = None, **kwargs) -> Model:
129131
"""Returns information about the specified model asset.
130132
131133
:param name: Name of the model.
132134
:type name: str
133-
:param version: Version of the model.
134-
:type version: str
135-
:param label: Label of the model. (mutually exclusive with version)
136-
:type label: str
135+
:keyword version: Version of the model.
136+
:paramtype version: str
137+
:keyword label: Label of the model. (mutually exclusive with version)
138+
:paramtype label: str
137139
:raises ~azure.ai.ml.exceptions.ValidationException: Raised if Model cannot be successfully validated.
138140
Details will be provided in the error message.
139141
:return: Model asset object.
@@ -150,7 +152,7 @@ def get(self, name: str, version: Optional[str] = None, label: Optional[str] = N
150152
return model
151153

152154
@monitor_with_activity(ops_logger, "Evaluator.Download", ActivityType.PUBLICAPI)
153-
def download(self, name: str, version: str, download_path: Union[PathLike, str] = ".") -> None:
155+
def download(self, name: str, version: str, download_path: Union[PathLike, str] = ".", **kwargs: Any) -> None:
154156
"""Download files related to a model.
155157
156158
:param name: Name of the model.
@@ -171,6 +173,7 @@ def list(
171173
stage: Optional[str] = None,
172174
*,
173175
list_view_type: ListViewType = ListViewType.ACTIVE_ONLY,
176+
**kwargs: Any,
174177
) -> Iterable[Model]:
175178
"""List all model assets in workspace.
176179

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def _azure_ai_assets(self) -> AzureAiAssetsClient042024:
9898
return self.__azure_ai_assets_client
9999

100100
@monitor_with_activity(ops_logger, "Index.CreateOrUpdate", ActivityType.PUBLICAPI)
101-
def create_or_update(self, index: Index) -> Index:
101+
def create_or_update(self, index: Index, **kwargs) -> Index:
102102
"""Returns created or updated index asset.
103103
104104
If not already in storage, asset will be uploaded to the workspace's default datastore.
@@ -154,12 +154,12 @@ def create_or_update(self, index: Index) -> Index:
154154

155155
return Index._from_rest_object(
156156
self._azure_ai_assets.indexes.create_or_update(
157-
name=index.name, version=index.version, body=index._to_rest_object()
157+
name=index.name, version=index.version, body=index._to_rest_object(), **kwargs
158158
)
159159
)
160160

161161
@monitor_with_activity(ops_logger, "Index.Get", ActivityType.PUBLICAPI)
162-
def get(self, name: str, *, version: Optional[str] = None, label: Optional[str] = None) -> Index:
162+
def get(self, name: str, *, version: Optional[str] = None, label: Optional[str] = None, **kwargs) -> Index:
163163
"""Returns information about the specified index asset.
164164
165165
:param str name: Name of the index asset.
@@ -193,7 +193,7 @@ def get(self, name: str, *, version: Optional[str] = None, label: Optional[str]
193193
error_type=ValidationErrorType.MISSING_FIELD,
194194
)
195195

196-
index_version_resource = self._azure_ai_assets.indexes.get(name=name, version=version)
196+
index_version_resource = self._azure_ai_assets.indexes.get(name=name, version=version, **kwargs)
197197

198198
return Index._from_rest_object(index_version_resource)
199199

@@ -202,7 +202,7 @@ def _get_latest_version(self, name: str) -> Index:
202202

203203
@monitor_with_activity(ops_logger, "Index.List", ActivityType.PUBLICAPI)
204204
def list(
205-
self, name: Optional[str] = None, *, list_view_type: ListViewType = ListViewType.ACTIVE_ONLY
205+
self, name: Optional[str] = None, *, list_view_type: ListViewType = ListViewType.ACTIVE_ONLY, **kwargs
206206
) -> Iterable[Index]:
207207
"""List all Index assets in workspace.
208208
@@ -221,6 +221,6 @@ def cls(rest_indexes: Iterable[RestIndex]) -> List[Index]:
221221
return [Index._from_rest_object(i) for i in rest_indexes]
222222

223223
if name is None:
224-
return self._azure_ai_assets.indexes.list_latest(cls=cls)
224+
return self._azure_ai_assets.indexes.list_latest(cls=cls, **kwargs)
225225

226-
return self._azure_ai_assets.indexes.list(name, list_view_type=list_view_type, cls=cls)
226+
return self._azure_ai_assets.indexes.list(name, list_view_type=list_view_type, cls=cls, **kwargs)

sdk/ml/azure-ai-ml/tests/evaluator/e2etests/test_evaluator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def test_crud_file(self, client: MLClient, randstr: Callable[[], str]) -> None:
6363
assert "is-evaluator" in model.properties and model.properties["is-evaluator"] == "true"
6464
assert re.match(LONG_URI_REGEX_FORMAT, model.path)
6565

66-
model = client.evaluators.get(model.name, "3")
66+
model = client.evaluators.get(name=model.name, version="3")
6767
assert model.name == model_name
6868
assert model.version == "3"
6969
assert model.description == "This is evaluator."
@@ -93,7 +93,7 @@ def test_crud_evaluator_with_stage(self, client: MLClient, randstr: Callable[[],
9393
assert model.stage == "Production"
9494
assert re.match(LONG_URI_REGEX_FORMAT, model.path)
9595

96-
model = client.evaluators.get(model.name, "3")
96+
model = client.evaluators.get(name=model.name, version="3")
9797
assert model.name == model_name
9898
assert model.version == "3"
9999
assert model.description == "This is evaluator."
@@ -108,7 +108,7 @@ def test_evaluators_get_latest_label(self, client: MLClient, randstr: Callable[[
108108
for version in ["1", "2", "3", "4"]:
109109
model = _load_flow(model_name, version=version)
110110
client.evaluators.create_or_update(model)
111-
assert client.evaluators.get(model_name, label="latest").version == version
111+
assert client.evaluators.get(name=model_name, label="latest").version == version
112112

113113
@pytest.mark.skip(
114114
"Skipping test for archive and restore as we have removed it from interface. "

0 commit comments

Comments
 (0)