Skip to content

Add 2026 WNBA expansion teams (Toronto Tempo, Portland Fire) to PRO_TEAM_MAP#695

Open
kohzy wants to merge 1 commit into
cwendt94:masterfrom
kohzy:add-2026-wnba-expansion-teams
Open

Add 2026 WNBA expansion teams (Toronto Tempo, Portland Fire) to PRO_TEAM_MAP#695
kohzy wants to merge 1 commit into
cwendt94:masterfrom
kohzy:add-2026-wnba-expansion-teams

Conversation

@kohzy

@kohzy kohzy commented May 9, 2026

Copy link
Copy Markdown

Summary

Adds the two new 2026 WNBA franchises to espn_api/wbasketball/constant.py::PRO_TEAM_MAP:

  • 131935: 'Tor' — Toronto Tempo
  • 132052: 'Por' — Portland Fire

Why

Without these entries, instantiating League(year=2026, ...) raises KeyError as soon as any roster contains a player on either franchise, because wbasketball/player.py:13 does an unguarded lookup:

self.proTeam = PRO_TEAM_MAP[json_parsing(data, 'proTeamId')]

Traceback:

File ".../espn_api/wbasketball/player.py", line 13, in __init__
    self.proTeam = PRO_TEAM_MAP[json_parsing(data, 'proTeamId')]
KeyError: 131935

This blocks all 2026 league access for any league with at least one Tempo or Fire player rostered (which in practice is most of them).

Repro

from espn_api.wbasketball import League
League(league_id=<id>, year=2026, espn_s2=..., swid=...)
# KeyError: 131935  (or 132052)

The fix follows the existing precedent for Golden State Valkyries (129689: 'GSV'), which was added to the same map last season.

Test plan

  • Verified IDs by hitting https://lm-api-reads.fantasy.espn.com/apis/v3/games/wfba/seasons/2026/segments/0/leagues/{id}?view=mTeam&view=mRoster and inspecting proTeamId values for known Tempo/Fire players.
  • Confirmed League(year=2026, ...) no longer raises and returns full rosters across multiple leagues after applying the patch.

🤖 Generated with Claude Code

Toronto Tempo (proTeamId=131935) and Portland Fire (proTeamId=132052)
joined the WNBA for the 2026 season. Without these mappings, instantiating
League(year=2026) raises KeyError in wbasketball/player.py when any team
roster contains a player on either franchise.

Repro:
    from espn_api.wbasketball import League
    League(league_id=<id>, year=2026, espn_s2=..., swid=...)
    # KeyError: 131935  (or 132052)
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