Skip to content

Commit bb9a00e

Browse files
catch TypeError exception
1 parent e28e31f commit bb9a00e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/sasctl/pzmm/mlflow_model.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
import yaml
5+
import json
56
from pathlib import Path
67

78

@@ -44,11 +45,13 @@ def read_mlflow_model_file(cls, m_path=Path.cwd()):
4445
}
4546
except KeyError:
4647
raise ValueError("This MLFlow model type is not currently supported.") from None
48+
except TypeError:
49+
raise ValueError("This MLFlow model type is not currently supported.") from None
4750

4851
# Read in the input and output variables
4952
try:
50-
inputs_dict = m_yml["signature"]["inputs"]
51-
outputs_dict = m_yml["signature"]["outputs"]
53+
inputs_dict = json.loads(m_yml["signature"]["inputs"])
54+
outputs_dict = json.loads(m_yml["signature"]["outputs"])
5255
except KeyError:
5356
raise ValueError(
5457
"Improper or unset signature values for model. No input or output "

0 commit comments

Comments
 (0)