Skip to content

Commit 0c6723d

Browse files
modelRef and targetVariable may not be in self.full_info["evaluation"] and should not fail the constructor (#184)
1 parent 49b442b commit 0c6723d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

dataikuapi/dss/modelevaluationstore.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,13 @@ def __init__(self, model_evaluation, full_info):
370370
self.creation_date = self.full_info["evaluation"]["created"] # type: int
371371
"""The date and time of the creation of the model evaluation, as an epoch."""
372372
self.full_id = self.full_info["evaluation"]["ref"]["fullId"] # type: str
373-
self.model_full_id = self.full_info["evaluation"]["modelRef"]["fullId"] # type: str
373+
if "modelRef" in self.full_info["evaluation"]:
374+
self.model_full_id = self.full_info["evaluation"]["modelRef"]["fullId"] # type: str
375+
else:
376+
self.model_full_id = None
374377
self.prediction_type = self.full_info["evaluation"]["predictionType"] # type: str
375378
self.prediction_variable = self.full_info["evaluation"]["predictionVariable"] # type: str
376-
self.target_variable = self.full_info["evaluation"]["targetVariable"] # type: str
379+
self.target_variable = self.full_info["evaluation"].get("targetVariable") # type: str
377380
self.user_meta = self.full_info["evaluation"]["userMeta"] # type: dict
378381
"""The user-accessible metadata (name, labels)
379382
Returns the original object, not a copy. Changes to the returned object are persisted to DSS by calling :meth:`save_user_meta`."""

0 commit comments

Comments
 (0)