Skip to content

Commit ec42ba9

Browse files
committed
More incorrect model format issues.
1 parent 7d892da commit ec42ba9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/sasctl/pzmm/writeScoreCode.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,14 @@ def score{modelPrefix}({inputVarList}):
381381
newVarList.extend(tempVar)
382382
# For non-H2O models, insert the model into the provided predictMethod call
383383
if not isH2OModel:
384-
predictMethod = predictMethod.format("_thisModelFit", "inputArray")
384+
try:
385+
predictMethod = predictMethod.format("_thisModelFit", "inputArray")
386+
except AttributeError:
387+
raise ValueError(
388+
"The following is not a valid model to register in this format. "
389+
+ "Please verify that the appropriate arguments have been provided "
390+
+ "to the import model function."
391+
)
385392
cls.pyFile.write(
386393
"""\n
387394
try:

0 commit comments

Comments
 (0)