Skip to content

Commit 558b21a

Browse files
authored
making workspace connections prop ga (#36781) (#36849)
* making wsconnection object and props ga * resolving pr comments related to ga entity * skipping e2e test
1 parent a3c7d76 commit 558b21a

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,6 @@ def feature_store_entities(self) -> FeatureStoreEntityOperations:
942942
return self._featurestoreentities
943943

944944
@property
945-
@experimental
946945
def connections(self) -> WorkspaceConnectionsOperations:
947946
"""A collection of connection related operations.
948947

sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/connections/workspace_connection.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,7 @@ def _to_dict(self) -> Dict:
422422
return res
423423

424424
@classmethod
425-
def _from_rest_object(cls, rest_obj: RestWorkspaceConnection) -> Optional["WorkspaceConnection"]:
426-
if not rest_obj:
427-
return None
428-
425+
def _from_rest_object(cls, rest_obj: RestWorkspaceConnection) -> "WorkspaceConnection":
429426
conn_class = cls._get_entity_class_from_rest_obj(rest_obj)
430427

431428
popped_metadata = conn_class._get_required_metadata_fields()
@@ -456,7 +453,7 @@ def _from_rest_object(cls, rest_obj: RestWorkspaceConnection) -> Optional["Works
456453
# No default in pop, this should fail if we somehow don't get a resource ID
457454
rest_kwargs["ai_services_resource_id"] = rest_kwargs.pop(camel_to_snake(CONNECTION_RESOURCE_ID_KEY))
458455
connection = conn_class(**rest_kwargs)
459-
return cast(Optional["WorkspaceConnection"], connection)
456+
return cast(WorkspaceConnection, connection)
460457

461458
def _validate(self) -> str:
462459
return str(self.name)

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from azure.ai.ml._utils.utils import _snake_to_camel
1919
from azure.ai.ml.entities._workspace.connections.workspace_connection import WorkspaceConnection
2020
from azure.core.credentials import TokenCredential
21+
from azure.core.tracing.decorator import distributed_trace
2122
from azure.ai.ml.entities._credentials import (
2223
ApiKeyConfiguration,
2324
)
@@ -70,6 +71,7 @@ def _try_fill_api_key(self, connection: WorkspaceConnection) -> None:
7071
if list_secrets_response.properties.credentials is not None:
7172
connection.credentials.key = list_secrets_response.properties.credentials.key
7273

74+
@distributed_trace
7375
@monitor_with_activity(ops_logger, "WorkspaceConnections.Get", ActivityType.PUBLICAPI)
7476
def get(self, name: str, *, populate_secrets: bool = False, **kwargs: Dict) -> WorkspaceConnection:
7577
"""Get a connection by name.
@@ -98,10 +100,11 @@ def get(self, name: str, *, populate_secrets: bool = False, **kwargs: Dict) -> W
98100
self._try_fill_api_key(connection)
99101
return connection # type: ignore[return-value]
100102

103+
@distributed_trace
101104
@monitor_with_activity(ops_logger, "WorkspaceConnections.CreateOrUpdate", ActivityType.PUBLICAPI)
102105
def create_or_update(
103106
self, workspace_connection: WorkspaceConnection, *, populate_secrets: bool = False, **kwargs: Any
104-
) -> Optional[WorkspaceConnection]:
107+
) -> WorkspaceConnection:
105108
"""Create or update a connection.
106109
107110
:param workspace_connection: Definition of a Workspace Connection or one of its subclasses
@@ -126,8 +129,9 @@ def create_or_update(
126129
self._try_fill_api_key(conn)
127130
return conn
128131

132+
@distributed_trace
129133
@monitor_with_activity(ops_logger, "WorkspaceConnections.Delete", ActivityType.PUBLICAPI)
130-
def delete(self, name: str) -> None:
134+
def delete(self, name: str, **kwargs: Any) -> None:
131135
"""Delete the connection.
132136
133137
:param name: Name of the connection.
@@ -138,8 +142,10 @@ def delete(self, name: str) -> None:
138142
connection_name=name,
139143
workspace_name=self._workspace_name,
140144
**self._scope_kwargs,
145+
**kwargs,
141146
)
142147

148+
@distributed_trace
143149
@monitor_with_activity(ops_logger, "WorkspaceConnections.List", ActivityType.PUBLICAPI)
144150
def list(
145151
self,

sdk/ml/azure-ai-ml/tests/feature_set/e2etests/test_feature_set.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def feature_set_validation(fset: FeatureSet):
6161
# ---------------------------------------------------------------------------------------------------------------#
6262
# NOTE Please enable materialization store on test featurestore 'sdk_vnext_cli_fs' to run this test in live mode.
6363
# ---------------------------------------------------------------------------------------------------------------#
64+
@pytest.mark.skip(reason="request header size being too large.")
6465
def test_list_materialization_jobs(
6566
self, feature_store_client: MLClient, tmp_path: Path, randstr: Callable[[], str]
6667
) -> None:

0 commit comments

Comments
 (0)