Skip to content

ESPN: surface per-team waiver priority rank in league/standings/team reads - #178

Merged
warnerktsang merged 2 commits into
mainfrom
espn-waiver-rank
Oct 30, 2026
Merged

warnerktsang merged 2 commits into
mainfrom
espn-waiver-rank

Conversation

@warnerktsang

Copy link
Copy Markdown
Collaborator

What

GET /espn/league team entries (and standings / team / snapshot reads, which share logic._slim_team) now carry waiver_rank — each team's current waiver priority — so claim-or-wait decisions can see where a team sits in the order.

Discovery note

The rank is per-team state, not a setting (it is not in the acquisitionSettings block surfaced in #177). No fixture or recorded payload sample in this repo carries a per-team waiver field — a repo-wide search for waiverRank / currentWaiverRank / waiver-priority keys across tests, fixtures, and payload samples came up empty. The read is therefore defensive, in the module's usual style:

  • _waiver_rank(team) tries waiverRank (canonical), then currentWaiverRank, then waiver_rank, accepting only plain ints; anything else (or absence) degrades to None.
  • The rank is never computed from standings or record — priority order is ESPN state, not derivable.

If the live payload uses yet another key, every team will read null after deploy and the key list can be extended in a follow-up — the shape consumers see does not change.

Tests

  • test_get_league_waiver_rank_parsed: teams carrying waiverRank / currentWaiverRank parse to the exact values; a team without the field reads None; pre-existing keys asserted untouched.
  • test_get_league_waiver_rank_absent_is_none: the default fixture (no waiver fields) yields None on all teams.
  • ESPN scope locally: 529 passed (527 baseline + 2 new).

Read-only; no new endpoints; no migration; every existing response key unchanged.

@warnerktsang
warnerktsang merged commit def5077 into main Oct 30, 2026
9 checks passed
@warnerktsang
warnerktsang deleted the espn-waiver-rank branch October 30, 2026 22:37
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