Skip to content

Commit

Permalink
Use get to avoid KeyError (microsoft#824)
Browse files Browse the repository at this point in the history
Co-authored-by: Qingyun Wu <[email protected]>
Co-authored-by: Kevin Chen <[email protected]>
  • Loading branch information
3 people authored Dec 7, 2022
1 parent aec19a6 commit 00c9875
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flaml/automl/automl.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def update(self, result, time_used):
n_iter = (
trained_estimator
and hasattr(trained_estimator, "ITER_HP")
and trained_estimator.params[trained_estimator.ITER_HP]
and trained_estimator.params.get(trained_estimator.ITER_HP)
)
if n_iter:
config[trained_estimator.ITER_HP] = n_iter
Expand Down

0 comments on commit 00c9875

Please sign in to comment.