fix: add pitcher_id null guard in _get_player_pairs
All checks were successful
Build Docker Image / build (pull_request) Successful in 8m53s

Prevents (None, team_id) tuples from being added to pitching_pairs
when a StratPlay row has no pitcher (edge case matching the existing
batter_id guard).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2026-03-23 12:50:16 -05:00
parent b68e280c64
commit d15fc97afb

View File

@ -76,7 +76,8 @@ def _get_player_pairs(game_id: int) -> tuple[set, set]:
for batter_id, batter_team_id, pitcher_id, pitcher_team_id in plays:
if batter_id is not None:
batting_pairs.add((batter_id, batter_team_id))
pitching_pairs.add((pitcher_id, pitcher_team_id))
if pitcher_id is not None:
pitching_pairs.add((pitcher_id, pitcher_team_id))
# Include pitchers who have a Decision but no StratPlay rows for this game
# (rare edge case, e.g. a pitcher credited with a decision without recording