Skip to content

Commit f9e1d3e

Browse files
authored
[ml] Update MLClient docstring (Azure#31787)
* Update MLClient docstring to remove reference to non-existent method and v1 * Indent code-block to align with Sphinx syntax
1 parent d7e4b6c commit f9e1d3e

File tree

1 file changed

+25
-45
lines changed

1 file changed

+25
-45
lines changed

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

Lines changed: 25 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
from pathlib import Path
1313
from typing import Any, Optional, Tuple, TypeVar, Union
1414

15-
from azure.core.credentials import TokenCredential
16-
from azure.core.polling import LROPoller
17-
1815
from azure.ai.ml._azure_environments import (
1916
CloudArgumentKeys,
2017
_add_cloud_to_environments,
@@ -27,36 +24,15 @@
2724
from azure.ai.ml._restclient.v2020_09_01_dataplanepreview import (
2825
AzureMachineLearningWorkspaces as ServiceClient092020DataplanePreview,
2926
)
30-
31-
from azure.ai.ml._restclient.v2022_02_01_preview import (
32-
AzureMachineLearningWorkspaces as ServiceClient022022Preview,
33-
)
34-
from azure.ai.ml._restclient.v2022_05_01 import (
35-
AzureMachineLearningWorkspaces as ServiceClient052022,
36-
)
37-
from azure.ai.ml._restclient.v2022_10_01 import (
38-
AzureMachineLearningWorkspaces as ServiceClient102022,
39-
)
40-
from azure.ai.ml._restclient.v2022_10_01_preview import (
41-
AzureMachineLearningWorkspaces as ServiceClient102022Preview,
42-
)
43-
from azure.ai.ml._restclient.v2023_02_01_preview import (
44-
AzureMachineLearningWorkspaces as ServiceClient022023Preview,
45-
)
46-
from azure.ai.ml._restclient.v2023_04_01 import (
47-
AzureMachineLearningWorkspaces as ServiceClient042023,
48-
)
49-
from azure.ai.ml._restclient.v2023_04_01_preview import (
50-
AzureMachineLearningWorkspaces as ServiceClient042023Preview,
51-
)
52-
from azure.ai.ml._restclient.v2023_06_01_preview import (
53-
AzureMachineLearningWorkspaces as ServiceClient062023Preview,
54-
)
55-
from azure.ai.ml._scope_dependent_operations import (
56-
OperationConfig,
57-
OperationsContainer,
58-
OperationScope,
59-
)
27+
from azure.ai.ml._restclient.v2022_02_01_preview import AzureMachineLearningWorkspaces as ServiceClient022022Preview
28+
from azure.ai.ml._restclient.v2022_05_01 import AzureMachineLearningWorkspaces as ServiceClient052022
29+
from azure.ai.ml._restclient.v2022_10_01 import AzureMachineLearningWorkspaces as ServiceClient102022
30+
from azure.ai.ml._restclient.v2022_10_01_preview import AzureMachineLearningWorkspaces as ServiceClient102022Preview
31+
from azure.ai.ml._restclient.v2023_02_01_preview import AzureMachineLearningWorkspaces as ServiceClient022023Preview
32+
from azure.ai.ml._restclient.v2023_04_01 import AzureMachineLearningWorkspaces as ServiceClient042023
33+
from azure.ai.ml._restclient.v2023_04_01_preview import AzureMachineLearningWorkspaces as ServiceClient042023Preview
34+
from azure.ai.ml._restclient.v2023_06_01_preview import AzureMachineLearningWorkspaces as ServiceClient062023Preview
35+
from azure.ai.ml._scope_dependent_operations import OperationConfig, OperationsContainer, OperationScope
6036
from azure.ai.ml._telemetry.logging_handler import get_appinsights_log_handler
6137
from azure.ai.ml._user_agent import USER_AGENT
6238
from azure.ai.ml._utils._experimental import experimental
@@ -103,16 +79,14 @@
10379
)
10480
from azure.ai.ml.operations._code_operations import CodeOperations
10581
from azure.ai.ml.operations._feature_set_operations import FeatureSetOperations
106-
from azure.ai.ml.operations._feature_store_entity_operations import (
107-
FeatureStoreEntityOperations,
108-
)
82+
from azure.ai.ml.operations._feature_store_entity_operations import FeatureStoreEntityOperations
10983
from azure.ai.ml.operations._feature_store_operations import FeatureStoreOperations
11084
from azure.ai.ml.operations._local_deployment_helper import _LocalDeploymentHelper
11185
from azure.ai.ml.operations._local_endpoint_helper import _LocalEndpointHelper
11286
from azure.ai.ml.operations._schedule_operations import ScheduleOperations
113-
from azure.ai.ml.operations._workspace_outbound_rule_operations import (
114-
WorkspaceOutboundRuleOperations,
115-
)
87+
from azure.ai.ml.operations._workspace_outbound_rule_operations import WorkspaceOutboundRuleOperations
88+
from azure.core.credentials import TokenCredential
89+
from azure.core.polling import LROPoller
11690

11791
module_logger = logging.getLogger(__name__)
11892

@@ -563,9 +537,7 @@ def __init__(
563537
self._operation_container.add(AzureMLResourceType.SCHEDULE, self._schedules)
564538

565539
try:
566-
from azure.ai.ml.operations._virtual_cluster_operations import (
567-
VirtualClusterOperations,
568-
)
540+
from azure.ai.ml.operations._virtual_cluster_operations import VirtualClusterOperations
569541

570542
self._virtual_clusters = VirtualClusterOperations(
571543
self._operation_scope,
@@ -625,9 +597,17 @@ def from_config(
625597
"""Returns a client from an existing Azure Machine Learning Workspace using a file configuration.
626598
627599
This method provides a simple way to reuse the same workspace across multiple Python notebooks or projects.
628-
Users can save the workspace Azure Resource Manager (ARM) properties using the
629-
[workspace.write_config](https://aka.ms/ml-workspace-class) method,
630-
and use this method to load the same workspace in different Python notebooks or projects without
600+
You can save a workspace's Azure Resource Manager (ARM) properties in a JSON configuration file using this
601+
format:
602+
603+
.. code-block:: json
604+
{
605+
"subscription_id": "<subscription-id>",
606+
"resource_group": "<resource-group>",
607+
"workspace_name": "<workspace-name>"
608+
}
609+
610+
Then, you can use this method to load the same workspace in different Python notebooks or projects without
631611
retyping the workspace ARM properties.
632612
633613
:param credential: The credential object for the workspace.

0 commit comments

Comments
 (0)