mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-22 13:20:38 +08:00
fix by lint
This commit is contained in:
@@ -173,14 +173,14 @@ def serialize_study_detail(
|
||||
|
||||
def serialize_preference_history(
|
||||
system_attrs: dict[str, Any],
|
||||
) -> list[History]:
|
||||
histories: list[History] = []
|
||||
) -> list[dict[str, Any]]:
|
||||
histories: list[dict[str, Any]] = []
|
||||
for k, v in system_attrs.items():
|
||||
if not k.startswith(_SYSTEM_ATTR_PREFIX_HISTORY):
|
||||
continue
|
||||
choice: dict[str, Any] = json.loads(v)
|
||||
if choice["mode"] == "ChooseWorst":
|
||||
history: ChooseWorstHistory = {
|
||||
history = {
|
||||
"mode": "ChooseWorst",
|
||||
"id": choice["id"],
|
||||
"preference_id": choice["preference_id"],
|
||||
|
||||
@@ -71,7 +71,7 @@ def test_undo_redo_history(storage_supplier: Callable[[], StorageSupplier]) -> N
|
||||
|
||||
study_id = study._study._study_id
|
||||
|
||||
def get_preferences_history(history_id: str):
|
||||
def get_preferences_history(history_id: str) -> tuple[list[tuple[int, int]], History]:
|
||||
system_attrs = storage.get_study_system_attrs(study_id)
|
||||
history: History = json.loads(
|
||||
system_attrs.get(_SYSTEM_ATTR_PREFIX_HISTORY + history_id, "")
|
||||
|
||||
Reference in New Issue
Block a user