From 8e6559e3eb3173d4a590b7322370c7756bb4d41a Mon Sep 17 00:00:00 2001 From: kdestin <101366538+kdestin@users.noreply.github.com> Date: Mon, 18 Mar 2024 16:48:10 -0400 Subject: [PATCH 1/6] fix: Expose DataAsset class publicly --- sdk/ml/azure-ai-ml/azure/ai/ml/entities/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/__init__.py index 75c08c62d535..60672bfb4a21 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/__init__.py @@ -83,6 +83,7 @@ from ._deployment.batch_job import BatchJob from ._deployment.code_configuration import CodeConfiguration from ._deployment.container_resource_settings import ResourceSettings +from ._deployment.data_asset import DataAsset from ._deployment.data_collector import DataCollector from ._deployment.deployment_collection import DeploymentCollection from ._deployment.deployment_settings import BatchRetrySettings, OnlineRequestSettings, ProbeSettings @@ -449,6 +450,7 @@ "ModelPerformanceRegressionThresholds", "DataCollector", "IntellectualProperty", + "DataAsset", "DeploymentCollection", "RequestLogging", "NoneCredentialConfiguration", From 1dd6ea61e4865782046dfcd4bd2ce21857679b1b Mon Sep 17 00:00:00 2001 From: kdestin <101366538+kdestin@users.noreply.github.com> Date: Mon, 18 Mar 2024 17:22:31 -0400 Subject: [PATCH 2/6] doc: Fix DataAsset docstring --- .../azure/ai/ml/entities/_deployment/data_asset.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_asset.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_asset.py index fb6a0fe381e1..0f1f5db2961e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_asset.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_asset.py @@ -13,15 +13,10 @@ class DataAsset: """Data Asset entity - :param data_id: Arm id of registered data asset - :param data_id: str - :param name: Name of data asset - :type name: str - :param path: Path where the data asset is stored. - :type path: str - :param version: Version of data asset. - :type version" int - + :ivar str data_id: Arm id of registered data asset + :ivar str name: Name of data asset + :ivar str path: Path where the data asset is stored. + :ivar int version: Version of data asset. """ def __init__( From 587fa9933daafbb42997f0e395efafd2234cd894 Mon Sep 17 00:00:00 2001 From: kdestin <101366538+kdestin@users.noreply.github.com> Date: Mon, 18 Mar 2024 19:19:35 -0400 Subject: [PATCH 3/6] refactor: Make DataAsset params keyword only --- .../azure/ai/ml/entities/_deployment/data_asset.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_asset.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_asset.py index 0f1f5db2961e..ef624497187c 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_asset.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_asset.py @@ -13,14 +13,15 @@ class DataAsset: """Data Asset entity - :ivar str data_id: Arm id of registered data asset - :ivar str name: Name of data asset - :ivar str path: Path where the data asset is stored. - :ivar int version: Version of data asset. + :keyword str data_id: Arm id of registered data asset + :keyword str name: Name of data asset + :keyword str path: Path where the data asset is stored. + :keyword int version: Version of data asset. """ def __init__( self, + *, data_id: Optional[str] = None, name: Optional[str] = None, path: Optional[str] = None, From 68bd5734af17b4d79bfceda4c114c587be59f6e4 Mon Sep 17 00:00:00 2001 From: kdestin <101366538+kdestin@users.noreply.github.com> Date: Mon, 18 Mar 2024 19:30:37 -0400 Subject: [PATCH 4/6] refactor: Remove kwargs from model --- .../azure-ai-ml/azure/ai/ml/entities/_deployment/data_asset.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_asset.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_asset.py index ef624497187c..e734c7400461 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_asset.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_asset.py @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- -from typing import Any, Dict, Optional +from typing import Dict, Optional from azure.ai.ml._schema._deployment.online.data_asset_schema import DataAssetSchema from azure.ai.ml._utils._experimental import experimental @@ -26,7 +26,6 @@ def __init__( name: Optional[str] = None, path: Optional[str] = None, version: Optional[int] = None, - **kwargs: Any, ): # pylint: disable=unused-argument self.data_id = data_id self.name = name From d876db0cc4b579bf5612943bf0d38965b2de10ac Mon Sep 17 00:00:00 2001 From: kdestin <101366538+kdestin@users.noreply.github.com> Date: Mon, 18 Mar 2024 19:34:24 -0400 Subject: [PATCH 5/6] refactor: Remove unused pylint directive --- .../azure-ai-ml/azure/ai/ml/entities/_deployment/data_asset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_asset.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_asset.py index e734c7400461..3484871f1162 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_asset.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_asset.py @@ -26,7 +26,7 @@ def __init__( name: Optional[str] = None, path: Optional[str] = None, version: Optional[int] = None, - ): # pylint: disable=unused-argument + ): self.data_id = data_id self.name = name self.path = path From 8466edad24b34d46f77aec35575c899e5c436cad Mon Sep 17 00:00:00 2001 From: kdestin <101366538+kdestin@users.noreply.github.com> Date: Mon, 18 Mar 2024 19:35:37 -0400 Subject: [PATCH 6/6] docs: Update typing in docstring --- .../azure/ai/ml/entities/_deployment/data_asset.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_asset.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_asset.py index 3484871f1162..72d241311864 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_asset.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_deployment/data_asset.py @@ -13,10 +13,10 @@ class DataAsset: """Data Asset entity - :keyword str data_id: Arm id of registered data asset - :keyword str name: Name of data asset - :keyword str path: Path where the data asset is stored. - :keyword int version: Version of data asset. + :keyword Optional[str] data_id: Arm id of registered data asset + :keyword Optional[str] name: Name of data asset + :keyword Optional[str] path: Path where the data asset is stored. + :keyword Optional[int] version: Version of data asset. """ def __init__(