From 7685cd5d0029883ddbcea9ce6e765a0aaebe2ee7 Mon Sep 17 00:00:00 2001 From: moririn2528 Date: Fri, 8 Sep 2023 17:03:45 +0900 Subject: [PATCH] fix by lint --- optuna_dashboard/_serializer.py | 6 +++--- python_tests/test_preferential_history.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/optuna_dashboard/_serializer.py b/optuna_dashboard/_serializer.py index bcbe1ddf..5ac9c55b 100644 --- a/optuna_dashboard/_serializer.py +++ b/optuna_dashboard/_serializer.py @@ -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"], diff --git a/python_tests/test_preferential_history.py b/python_tests/test_preferential_history.py index e1e18b6e..75e622db 100644 --- a/python_tests/test_preferential_history.py +++ b/python_tests/test_preferential_history.py @@ -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, "")