Skip to content

Commit

Permalink
Merge pull request #269 from c-bata/warn-import-error
Browse files Browse the repository at this point in the history
Show warning messages when failed to import optuna-fast-fanova
  • Loading branch information
c-bata committed Sep 15, 2022
2 parents 126f761 + 5874293 commit 8206248
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion optuna_dashboard/_importance.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import Dict
from typing import List
from typing import Tuple
import warnings

from optuna.importance import BaseImportanceEvaluator
from optuna.importance import FanovaImportanceEvaluator
Expand All @@ -19,7 +20,10 @@

try:
from optuna_fast_fanova import FanovaImportanceEvaluator as FastFanovaImportanceEvaluator
except (ImportError, ValueError):
except ModuleNotFoundError:
FastFanovaImportanceEvaluator = None # type: ignore
except Exception as e:
warnings.warn(f"Failed to import optuna-fast-fanova: {e}")
FastFanovaImportanceEvaluator = None # type: ignore


Expand Down

0 comments on commit 8206248

Please sign in to comment.