fix by lint

This commit is contained in:
moririn2528
2023-09-08 17:03:45 +09:00
parent 2f1cb91886
commit 7685cd5d00
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -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"],
+1 -1
View File
@@ -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, "")