Repository navigation
refactor(helpers): narrow TB reward table ids to str in get_tb_mission_scores - #184
Merged
Merged
Conversation
…n_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 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Unblocks #175 (ty 0.0.56 → 0.0.86), whose Type Check fails on:
The comprehension filtered on one
.get()call but yielded a second, un-narrowed one:This is the same walrus idiom the scoring loop below it already uses (
if not (table_id := zone.get(...))). Behavior is unchanged, and each zone's id is now looked up once.Related Issues
Unblocks #175. Once this is in
develop,@dependabot rebaseon #175 should turn its Type Check green.Type of Change
Checklist
developbranchCHANGELOG.mdby handTestGetTbMissionScores.test_invalid_input_raises, missing-table case(_TB_DEFS, _TB_TABLES[1:]))uv run pytest tests/unit: 1511 passed)src/andtests/Testing
uv run ty check src/swgoh_comlink/(locked ty 0.0.56)uvx ty@0.0.86 check src/swgoh_comlink/uv run pytest tests/unitgit merge-treeagainst #175's head merges cleanly.Merge danger: two-way door. The blast radius is one internal set comprehension in
get_tb_mission_scores, with no public API or output change.🤖 Generated with Claude Code