Fix lint errors

This commit is contained in:
c-bata
2023-01-02 01:07:15 +09:00
parent 618ad8e312
commit 35cd2e00d0
2 changed files with 3 additions and 6 deletions
+1 -4
View File
@@ -1,7 +1,6 @@
from __future__ import annotations
import threading
from typing import List
from typing import TYPE_CHECKING
import warnings
@@ -63,9 +62,7 @@ def get_param_importance_from_trials_cache(
cache_key = f"{study_id}:{objective_id}"
with param_importance_cache_lock:
cache_n_trial, cache_importance = param_importance_cache.get(
cache_key, (0, {"param_importances": []})
)
cache_n_trial, cache_importance = param_importance_cache.get(cache_key, (0, []))
if n_completed_trials == cache_n_trial:
return cache_importance
+2 -2
View File
@@ -8,8 +8,8 @@ from optuna.storages import BaseStorage
if TYPE_CHECKING:
from typing import TypedDict
from typing import Optional
from typing import TypedDict
NoteType = TypedDict(
"NoteType",
@@ -29,7 +29,7 @@ def note_ver_key(trial_id: Optional[int]) -> str:
return f"dashboard:{trial_id}:note_ver"
def note_str_key_prefix(trial_id: int) -> str:
def note_str_key_prefix(trial_id: Optional[int]) -> str:
prefix = "dashboard:note_str:"
if trial_id is None:
return prefix