Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert ws connection expiryTime change to unblock 1.8.0 #30701

Merged
merged 2 commits into from
Jun 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class WorkspaceConnectionSchema(PathAwareSchema):
required=True,
)
target = fields.Str()
expiryTime = fields.Str()
credentials = UnionField(
[
NestedField(PatTokenConfigurationSchema),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
from pathlib import Path
from typing import IO, Any, AnyStr, Dict, Optional, Union

from azure.ai.ml._restclient.v2023_04_01_preview.models import (
from azure.ai.ml._restclient.v2022_01_01_preview.models import (
ManagedIdentityAuthTypeWorkspaceConnectionProperties,
NoneAuthTypeWorkspaceConnectionProperties,
PATAuthTypeWorkspaceConnectionProperties,
SASAuthTypeWorkspaceConnectionProperties,
ServicePrincipalAuthTypeWorkspaceConnectionProperties,
UsernamePasswordAuthTypeWorkspaceConnectionProperties,
)
from azure.ai.ml._restclient.v2023_04_01_preview.models import (
from azure.ai.ml._restclient.v2022_01_01_preview.models import (
WorkspaceConnectionPropertiesV2BasicResource as RestWorkspaceConnection,
)
from azure.ai.ml._restclient.v2023_04_01_preview.models import (
Expand Down Expand Up @@ -50,8 +50,6 @@ class WorkspaceConnection(Resource):
:type name: str
:param target: The URL or ARM resource ID of the external resource.
:type target: str
:param expiryTime: The expiry time of the workspace connection secret
:type expiryTime: str
:param credentials: The credentials for authenticating to the external resource.
:type credentials: Union[
~azure.ai.ml.entities.PatTokenConfiguration, ~azure.ai.ml.entities.SasTokenConfiguration,
Expand Down Expand Up @@ -79,13 +77,11 @@ def __init__(
ServicePrincipalConfiguration,
AccessKeyConfiguration,
],
expiryTime: Optional[str] = None,
metadata: Optional[Dict[str, Any]] = None,
**kwargs,
):
self.type = type
self._target = target
self._expiryTime = expiryTime
self._credentials = credentials
self._metadata = json.loads(json.dumps(metadata))
super().__init__(**kwargs)
Expand All @@ -105,15 +101,6 @@ def type(self, value: str):
return
self._type = camel_to_snake(value)

@property
def expiryTime(self) -> str:
"""Secret expiry time for workspace connection.
:return: Secret expiry time for workspace connection.
:rtype: str
"""
return self._expiryTime

@property
def target(self) -> str:
"""Target url for the workspace connection.
Expand Down Expand Up @@ -221,7 +208,6 @@ def _from_rest_object(cls, rest_obj: RestWorkspaceConnection) -> "WorkspaceConne
id=rest_obj.id,
name=rest_obj.name,
target=properties.target,
expiryTime=properties.expiry_time,
creation_context=SystemData._from_rest_object(rest_obj.system_data) if rest_obj.system_data else None,
type=camel_to_snake(properties.category),
credentials=credentials,
Expand Down Expand Up @@ -256,7 +242,6 @@ def _to_rest_object(self) -> RestWorkspaceConnection:
target=self.target,
credentials=self.credentials._to_workspace_connection_rest_object(),
metadata=self.metadata,
expiry_time=self.expiryTime,
# auth_type=auth_type,
category=_snake_to_camel(self.type),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from typing import Dict, Iterable, Optional

from azure.ai.ml._restclient.v2023_04_01_preview import AzureMachineLearningWorkspaces as ServiceClient042023Preview
from azure.ai.ml._restclient.v2022_05_01 import AzureMachineLearningWorkspaces as ServiceClient052022
from azure.ai.ml._scope_dependent_operations import (
OperationConfig,
OperationsContainer,
Expand Down Expand Up @@ -34,7 +34,7 @@ def __init__(
self,
operation_scope: OperationScope,
operation_config: OperationConfig,
service_client: ServiceClient042023Preview,
service_client: ServiceClient052022,
all_operations: OperationsContainer,
credentials: Optional[TokenCredential] = None,
**kwargs: Dict,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ def mock_credential() -> Mock:
@pytest.fixture
def mock_feature_store_operation(
mock_workspace_scope: OperationScope,
mock_aml_services_2023_04_01_preview: Mock,
mock_aml_services_2022_12_01_preview: Mock,
mock_machinelearning_client: Mock,
mock_credential: Mock,
) -> FeatureStoreOperations:
yield FeatureStoreOperations(
operation_scope=mock_workspace_scope,
service_client=mock_aml_services_2023_04_01_preview,
service_client=mock_aml_services_2022_12_01_preview,
all_operations=mock_machinelearning_client._operation_container,
credentials=mock_credential,
)
Expand Down
Loading