Repository navigation
Waivers: games_next_7d from the public scoreboard when the pro-games block is absent - #179
Open
warnerktsang wants to merge 2 commits into
Open
warnerktsang wants to merge 2 commits into
warnerktsang wants to merge 2 commits into
Conversation
…gue payload has no pro-games block
…coverage, outage)
warnerktsang
added a commit
that referenced
this pull request
Oct 30, 2026
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.
Problem
GET /espn/waiversreportsgames_next_7d = 0for every player this season: the league payload carries noproGamesByScoringPeriodblock, and the scoreboard fallback in_team_games_next_7dcould only anchor period dates off that same block — no block, no anchor, no schedule. The schedule-edge pocket-pick rule has been dormant.Fix
Derive the schedule from ESPN's public scoreboard (the
ScoreboardClientthe waivers route already injects):get_waiversnow tracks a period anchor(period, date): captured when the current period itself is derived from the scoreboard's season start, and otherwise computed fromfirst_regular_season_datewhen the payload carries no dated schedule at all and the period came straight fromstatus. The anchor lookup is wrapped so a scoreboard outage there degrades to today's behaviour instead of failing the report._team_games_next_7d(..., anchor=...)uses the block's own date map when it publishes one (unchanged precedence — the block stays authoritative), else the supplied anchor, to date each upcoming period forscoreboard.teams_on(day).games_next_7d covers N of the next 7 days (the rest could not be determined); counts may understate).Notes / assumptions
proTeamId(scoreboard.py's documented contract). Counts are keyed by id end to end; the known 27/28 abbreviation discrepancy is display-only (PRO_TEAM_ABBRuntouched).FakeScoreboardtest double gained ateams_on(empty slate) so it models the full injected interfaceget_waiversnow uses.Tests
Four new tests in
test_espn_waivers.pywith a programmableFakeScheduleScoreboard(its slate mirrors the fixture pro-games block, so expected counts match the block-based tests):covers 4 of the next 7 days, report intact;covers 0 of the next 7 daysnote, report intact.ESPN scope locally: 531 passed (527 baseline + 4 new). Read-only; no new endpoints; no migration.