Skip to content

ESPN: fix rotated pro-team labels 26/27/28 (UTA/WAS/TOR), single-source the map - #182

Merged
warnerktsang merged 3 commits into
mainfrom
espn-pro-team-abbr-fix
Oct 31, 2026
Merged

warnerktsang merged 3 commits into
mainfrom
espn-pro-team-abbr-fix

Conversation

@warnerktsang

Copy link
Copy Markdown
Collaborator

What

Fixes a verified display bug: waivers.py's private PRO_TEAM_ABBR copy had pro teams 26/27/28 rotated, so the waiver report (and roster-edit previews) mislabeled players — e.g. it printed Utah's Mo Bamba as "TOR", which produced a wrong "Bamba plays for Toronto" claim to the user on 2026-10-30.

id before (waivers) after evidence (live roster payloads)
26 TOR UTA Mo Bamba, Lauri Markkanen, Keyonte George all carry pro_team_id 26
27 UTA WAS Bilal Coulibaly carries 27; scoreboard.py already treated 27 as Washington
28 WAS TOR Scottie Barnes carries 28

Audit

  • Every other entry (1–25, 29, 30) was checked against scoreboard.py's documented id space and the canonical ESPN pro-team ids: no other disagreements. scoreboard.py itself agrees with the anchors everywhere (no change needed there beyond hosting the map; its docstring's "WSH" spelling for 27 is normalized to "WAS" to match the map's style).
  • Backend-wide grep: waivers.py held the only hardcoded id→abbreviation map. lineup.py works purely in numeric ids; roster_edits.py / trades.py already read waivers.PRO_TEAM_ABBR, so they inherit the fix.

Structure

Single source of truth: the canonical map now lives in espn/scoreboard.py (the module that owns the pro-team-id space), and waivers.py imports/re-exports it, so the two modules cannot drift again. The stale waivers comment that asserted the wrong rotation (and claimed scoreboard was wrong) is replaced with the anchor history.

Scope

Display-layer only: games_next_7d counts and all FP math are keyed by numeric id and unchanged; response shapes unchanged (same pro_team field, corrected values). ESPN tests: 559 → 562 passed (3 new tests pin the anchors, the full canonical map, and the waivers↔scoreboard single-source identity). Full backend suite shows the same 6 pre-existing Dice/Trips local-harness failures as unmodified main.

@warnerktsang
warnerktsang merged commit 86ba4b9 into main Oct 31, 2026
9 checks passed
@warnerktsang
warnerktsang deleted the espn-pro-team-abbr-fix branch October 31, 2026 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant