From 35cd2e00d025e7b3d33b5ad365bcc8dc0abc8560 Mon Sep 17 00:00:00 2001 From: c-bata Date: Mon, 2 Jan 2023 01:07:15 +0900 Subject: [PATCH] Fix lint errors --- optuna_dashboard/_importance.py | 5 +---- optuna_dashboard/_note.py | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/optuna_dashboard/_importance.py b/optuna_dashboard/_importance.py index ec6507e1..5b375597 100644 --- a/optuna_dashboard/_importance.py +++ b/optuna_dashboard/_importance.py @@ -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 diff --git a/optuna_dashboard/_note.py b/optuna_dashboard/_note.py index b87186e9..4e872e1e 100644 --- a/optuna_dashboard/_note.py +++ b/optuna_dashboard/_note.py @@ -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