Skip to content

Commit 769ed08

Browse files
authored
2023 August preview restclient regen (#33467)
* 2023 August preview restclient regen * services -> workspaces in mlclient * services -> workspaces * services -> workspaces * services -> workspaces * e2e test * e2e test
1 parent 35f545c commit 769ed08

File tree

132 files changed

+88325
-62769
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+88325
-62769
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_9a5bdbb66a"
5+
"Tag": "python/ml/azure-ai-ml_dc05917b7a"
66
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535
from azure.ai.ml._restclient.v2023_04_01 import AzureMachineLearningWorkspaces as ServiceClient042023
3636
from azure.ai.ml._restclient.v2023_04_01_preview import AzureMachineLearningWorkspaces as ServiceClient042023Preview
3737
from azure.ai.ml._restclient.v2023_06_01_preview import AzureMachineLearningWorkspaces as ServiceClient062023Preview
38+
from azure.ai.ml._restclient.v2023_08_01_preview import AzureMachineLearningWorkspaces as ServiceClient082023Preview
3839

3940
# Same object, but was renamed starting in v2023_08_01_preview
40-
from azure.ai.ml._restclient.v2023_08_01_preview import AzureMachineLearningServices as ServiceClient082023Preview
4141
from azure.ai.ml._restclient.v2023_10_01 import AzureMachineLearningServices as ServiceClient102023
4242
from azure.ai.ml._scope_dependent_operations import OperationConfig, OperationsContainer, OperationScope
4343
from azure.ai.ml._telemetry.logging_handler import get_appinsights_log_handler

sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/__init__.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,13 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from ._azure_machine_learning_services import AzureMachineLearningServices
9+
from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces
1010
from ._version import VERSION
1111

1212
__version__ = VERSION
13+
__all__ = ['AzureMachineLearningWorkspaces']
1314

14-
try:
15-
from ._patch import * # pylint: disable=unused-wildcard-import
16-
from ._patch import __all__ as _patch_all
17-
except ImportError:
18-
_patch_all = []
19-
from ._patch import patch_sdk as _patch_sdk
20-
21-
__all__ = [
22-
"AzureMachineLearningServices",
23-
]
24-
__all__.extend([p for p in _patch_all if p not in __all__])
25-
26-
_patch_sdk()
15+
# `._patch.py` is used for handwritten extensions to the generated code
16+
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
17+
from ._patch import patch_sdk
18+
patch_sdk()

sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/_azure_machine_learning_services.py renamed to sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/_azure_machine_learning_workspaces.py

Lines changed: 84 additions & 166 deletions
Large diffs are not rendered by default.

sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2023_08_01_preview/_configuration.py

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
from typing import TYPE_CHECKING, Any
9+
from typing import TYPE_CHECKING
1010

1111
from azure.core.configuration import Configuration
1212
from azure.core.pipeline import policies
@@ -16,27 +16,35 @@
1616

1717
if TYPE_CHECKING:
1818
# pylint: disable=unused-import,ungrouped-imports
19+
from typing import Any
20+
1921
from azure.core.credentials import TokenCredential
2022

2123

22-
class AzureMachineLearningServicesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
23-
"""Configuration for AzureMachineLearningServices.
24+
class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
25+
"""Configuration for AzureMachineLearningWorkspaces.
2426
2527
Note that all parameters used to create this instance are saved as instance
2628
attributes.
2729
28-
:param credential: Credential needed for the client to connect to Azure. Required.
30+
:param credential: Credential needed for the client to connect to Azure.
2931
:type credential: ~azure.core.credentials.TokenCredential
30-
:param subscription_id: The ID of the target subscription. Required.
32+
:param subscription_id: The ID of the target subscription.
3133
:type subscription_id: str
32-
:keyword api_version: Api Version. Default value is "2023-08-01-preview". Note that overriding
33-
this default value may result in unsupported behavior.
34+
:keyword api_version: Api Version. The default value is "2023-08-01-preview". Note that
35+
overriding this default value may result in unsupported behavior.
3436
:paramtype api_version: str
3537
"""
3638

37-
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
38-
super(AzureMachineLearningServicesConfiguration, self).__init__(**kwargs)
39-
api_version: str = kwargs.pop("api_version", "2023-08-01-preview")
39+
def __init__(
40+
self,
41+
credential, # type: "TokenCredential"
42+
subscription_id, # type: str
43+
**kwargs # type: Any
44+
):
45+
# type: (...) -> None
46+
super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs)
47+
api_version = kwargs.pop('api_version', "2023-08-01-preview") # type: str
4048

4149
if credential is None:
4250
raise ValueError("Parameter 'credential' must not be None.")
@@ -46,21 +54,23 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs
4654
self.credential = credential
4755
self.subscription_id = subscription_id
4856
self.api_version = api_version
49-
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
50-
kwargs.setdefault("sdk_moniker", "mgmt-machinelearningservices/{}".format(VERSION))
57+
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
58+
kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION))
5159
self._configure(**kwargs)
5260

53-
def _configure(self, **kwargs: Any) -> None:
54-
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
55-
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
56-
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
57-
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
58-
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
59-
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
60-
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
61-
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
62-
self.authentication_policy = kwargs.get("authentication_policy")
61+
def _configure(
62+
self,
63+
**kwargs # type: Any
64+
):
65+
# type: (...) -> None
66+
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
67+
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
68+
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
69+
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
70+
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
71+
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
72+
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
73+
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
74+
self.authentication_policy = kwargs.get('authentication_policy')
6375
if self.credential and not self.authentication_policy:
64-
self.authentication_policy = ARMChallengeAuthenticationPolicy(
65-
self.credential, *self.credential_scopes, **kwargs
66-
)
76+
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)

0 commit comments

Comments
 (0)