Skip to content

Commit 0cf870c

Browse files
committed
Add importError for mlflow
1 parent 98e8833 commit 0cf870c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/sagemaker/mlflow/forward_sagemaker_metrics.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@
2020
import re
2121
from typing import Set, Tuple, List, Dict, Generator
2222
import boto3
23-
import mlflow
23+
24+
try:
25+
import mlflow
26+
except ImportError:
27+
raise ValueError("Unable to import mlflow, check if sagemaker-mlflow is installed.")
2428
from mlflow import MlflowClient
2529
from mlflow.entities import Metric, Param, RunTag
2630

0 commit comments

Comments
 (0)