From 4edfb76eb87167edb244f6b4a4ca1aec47fafb5b Mon Sep 17 00:00:00 2001 From: MarTrepodi Date: Tue, 13 Oct 2026 08:54:52 -0400 Subject: [PATCH] refactor(helpers): narrow TB reward table ids to str in get_tb_mission_scores The set comprehension filtered on one zone.get("encounterRewardTableId") call but yielded a second, so its elements stayed typed Any | None. ty 0.0.86 (Dependabot PR #175) rejects sorting such a set. Bind the id with a walrus in the filter, as the scoring loop below already does, and annotate the set as set[str]. Behaviour is unchanged. Co-Authored-By: Claude Opus 5.5 --- src/swgoh_comlink/helpers/_territory_battle.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/swgoh_comlink/helpers/_territory_battle.py b/src/swgoh_comlink/helpers/_territory_battle.py index a377426..de3b1c5 100644 --- a/src/swgoh_comlink/helpers/_territory_battle.py +++ b/src/swgoh_comlink/helpers/_territory_battle.py @@ -520,11 +520,11 @@ def get_tb_mission_scores( definitions = _select_definitions(territory_battle_definitions, None, tb_id, func_name) _check_collection("tables", tables, func_name) - wanted = { - zone.get("encounterRewardTableId") + wanted: set[str] = { + table_id for definition in definitions for _, zone in _mission_zones(definition) - if zone.get("encounterRewardTableId") + if (table_id := zone.get("encounterRewardTableId")) } # 'table' holds every kind of game table; only parse the ones a mission names. curves: dict[str, list[int]] = {}