Skip to content

Commit

Permalink
Handle Missing Properties from Workspace Operations Classes (#36461)
Browse files Browse the repository at this point in the history
* Update workspace.py

* Update workspace.py
  • Loading branch information
matferrari-msft authored Jul 15, 2024
1 parent 91c9500 commit 2bb1eec
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,14 @@ def _from_rest_object(cls, rest_obj: RestWorkspace) -> Optional["Workspace"]:
if hasattr(rest_obj, "ml_flow_tracking_uri"):
mlflow_tracking_uri = rest_obj.ml_flow_tracking_uri

# TODO: Remove once Online Endpoints updates API version to at least 2023-08-01
allow_roleassignment_on_rg = None
if hasattr(rest_obj, "allow_roleassignment_on_rg"):
allow_roleassignment_on_rg = rest_obj.allow_roleassignment_on_rg
system_datastores_auth_mode = None
if hasattr(rest_obj, "system_datastores_auth_mode"):
system_datastores_auth_mode = rest_obj.system_datastores_auth_mode

# TODO: remove this once it is included in API response
managed_network = None
if hasattr(rest_obj, "managed_network"):
Expand Down Expand Up @@ -386,10 +394,10 @@ def _from_rest_object(cls, rest_obj: RestWorkspace) -> Optional["Workspace"]:
identity=identity,
primary_user_assigned_identity=rest_obj.primary_user_assigned_identity,
managed_network=managed_network,
system_datastores_auth_mode=rest_obj.system_datastores_auth_mode,
system_datastores_auth_mode=system_datastores_auth_mode,
feature_store_settings=feature_store_settings,
enable_data_isolation=rest_obj.enable_data_isolation,
allow_roleassignment_on_rg=rest_obj.allow_roleassignment_on_rg,
allow_roleassignment_on_rg=allow_roleassignment_on_rg,
hub_id=rest_obj.hub_resource_id,
workspace_id=rest_obj.workspace_id,
serverless_compute=serverless_compute,
Expand Down

0 comments on commit 2bb1eec

Please sign in to comment.