Skip to content

Commit e95bc99

Browse files
authored
Fix error NoneType object is not subscriptable (Azure#38493)
1 parent 7b18366 commit e95bc99

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

sdk/ml/azure-ai-ml/azure/ai/ml/entities/_feature_store/feature_store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def _from_rest_object(
171171
if not rest_obj:
172172
return None
173173

174-
workspace_object = Workspace._from_rest_object(rest_obj)
174+
workspace_object = Workspace._from_rest_object(rest_obj, v2_service_context)
175175
if workspace_object is not None:
176176
return FeatureStore(
177177
name=str(workspace_object.name),

sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/workspace.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,13 @@ def _from_rest_object(
341341

342342
if hasattr(rest_obj, "ml_flow_tracking_uri"):
343343
try:
344-
from azureml.mlflow import get_mlflow_tracking_uri_v2
344+
if v2_service_context:
345+
# v2_service_context is required (not None) in get_mlflow_tracking_uri_v2
346+
from azureml.mlflow import get_mlflow_tracking_uri_v2
345347

346-
mlflow_tracking_uri = get_mlflow_tracking_uri_v2(rest_obj, v2_service_context)
348+
mlflow_tracking_uri = get_mlflow_tracking_uri_v2(rest_obj, v2_service_context)
349+
else:
350+
mlflow_tracking_uri = rest_obj.ml_flow_tracking_uri
347351
except ImportError:
348352
mlflow_tracking_uri = rest_obj.ml_flow_tracking_uri
349353
error_msg = (

0 commit comments

Comments
 (0)