From a1ae10ba6be9a47d9962466505aafebcd7a2b773 Mon Sep 17 00:00:00 2001 From: Miles Holland Date: Tue, 18 Oct 2022 15:35:13 -0400 Subject: [PATCH 1/4] change imports to avoid extra experimental warnings --- .../azure-ai-ml/azure/ai/ml/entities/_registry/registry.py | 5 ++++- .../azure/ai/ml/operations/_registry_operations.py | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py index 781a7d52274b..9135461c4a56 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_registry/registry.py @@ -14,7 +14,6 @@ ) from azure.ai.ml._restclient.v2022_10_01_preview.models import Registry as RestRegistry from azure.ai.ml._restclient.v2022_10_01_preview.models import RegistryProperties -from azure.ai.ml._schema.registry.registry import RegistrySchema from azure.ai.ml._utils.utils import dump_yaml_to_file from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, PARAMS_OVERRIDE_KEY from azure.ai.ml.entities._credentials import IdentityConfiguration @@ -103,6 +102,8 @@ def dump( # represented by the registry API, which differs from how registries # are represented in YAML. This function converts those differences. def _to_dict(self) -> Dict: + # JIT import to avoid experimental warnings on unrelated calls + from azure.ai.ml._schema.registry.registry import RegistrySchema # pylint: disable=no-member schema = RegistrySchema(context={BASE_PATH_CONTEXT_KEY: "./"}) @@ -142,6 +143,8 @@ def _load( BASE_PATH_CONTEXT_KEY: Path(yaml_path).parent if yaml_path else Path("./"), PARAMS_OVERRIDE_KEY: params_override, } + # JIT import to avoid experimental warnings on unrelated calls + from azure.ai.ml._schema.registry.registry import RegistrySchema loaded_schema = load_from_dict(RegistrySchema, data, context, **kwargs) cls._convert_yaml_dict_to_entity_input(loaded_schema) return Registry(**loaded_schema) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py index 512776c0d485..f5b4a0e17568 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py @@ -24,7 +24,6 @@ ops_logger = OpsLogger(__name__) module_logger = ops_logger.module_logger -@experimental class RegistryOperations: """RegistryOperations. @@ -51,6 +50,7 @@ def __init__( self.containerRegistry = "none" self._init_kwargs = kwargs + @experimental #@ monitor_with_activity(logger, "Registry.List", ActivityType.PUBLICAPI) def list(self, *, scope: str = Scope.RESOURCE_GROUP) -> Iterable[Registry]: """List all registries that the user has access to in the current @@ -68,6 +68,7 @@ def list(self, *, scope: str = Scope.RESOURCE_GROUP) -> Iterable[Registry]: return self._operation.list(cls=lambda objs: [Registry._from_rest_object(obj) for obj in objs], \ resource_group_name=self._resource_group_name) + @experimental # @monitor_with_activity(logger, "Registry.Get", ActivityType.PUBLICAPI) def get(self, name: str = None) -> Registry: """Get a registry by name. @@ -108,6 +109,7 @@ def _get_polling(self, name): path_format_arguments=path_format_arguments, ) + @experimental # @monitor_with_activity(logger, "Registry.BeginCreate", ActivityType.PUBLICAPI) def begin_create( self, From be91ad2a937ff7975d3d27c57e50df6db9d2ec34 Mon Sep 17 00:00:00 2001 From: Miles Holland Date: Tue, 18 Oct 2022 15:37:06 -0400 Subject: [PATCH 2/4] add tag to merged functon --- .../azure-ai-ml/azure/ai/ml/operations/_registry_operations.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py index a92107888a27..fb6139a5ed61 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/operations/_registry_operations.py @@ -138,6 +138,7 @@ def begin_create( return poller + @experimental # @monitor_with_activity(logger, "Registry.Delete", ActivityType.PUBLICAPI) def delete(self, *, name: str, **kwargs: Dict) -> None: """Delete a registry. Returns nothing on a successful operation. From 8021aea4b699a42c5130d7431f18c8ef446dbc84 Mon Sep 17 00:00:00 2001 From: Miles Holland Date: Wed, 19 Oct 2022 10:43:19 -0400 Subject: [PATCH 3/4] cl --- sdk/ml/azure-ai-ml/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/ml/azure-ai-ml/CHANGELOG.md b/sdk/ml/azure-ai-ml/CHANGELOG.md index bdef0df024a3..edd8ea1f8005 100644 --- a/sdk/ml/azure-ai-ml/CHANGELOG.md +++ b/sdk/ml/azure-ai-ml/CHANGELOG.md @@ -11,6 +11,7 @@ ### Bugs Fixed - MLClient.from_config can now find the default config.json on Compute Instance when running sample notebooks. +- Adjust registry experimental tags and imports to avoid warning printouts for unrelated operations. ### Other Changes From 548adcd440f9e065a4395dc63415232a881e4fe0 Mon Sep 17 00:00:00 2001 From: Miles Holland Date: Wed, 19 Oct 2022 11:46:06 -0400 Subject: [PATCH 4/4] add experimental tag to registry property --- sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py index bbc7d7d8a1cd..38aaf3170b04 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py @@ -32,6 +32,7 @@ from azure.ai.ml._restclient.v2022_10_01 import AzureMachineLearningWorkspaces as ServiceClient102022 from azure.ai.ml._scope_dependent_operations import OperationConfig, OperationsContainer, OperationScope from azure.ai.ml._user_agent import USER_AGENT +from azure.ai.ml._utils._experimental import experimental from azure.ai.ml._utils._http_utils import HttpPipeline from azure.ai.ml._utils._registry_utils import RegistryDiscovery from azure.ai.ml._utils.utils import _is_https_url, _validate_missing_sub_or_rg_and_raise @@ -562,6 +563,7 @@ def workspaces(self) -> WorkspaceOperations: return self._workspaces @property + @experimental def registries(self) -> RegistryOperations: """A collection of registry-related operations.