Spaces:
Sleeping

Syntrex Claude Sonnet 4.6 commited on
Commit
7b92abe
·
1 Parent(s): 07e8342

Fix all odds paths: per-event endpoint + regions + cache bypass

Browse files

Upcoming path (Props page):
- Add regions=us to per-event odds_params (documented as required; absence
caused API to return bookmakers:[] silently, producing zero rows)
- Lower _MAX_EVENTS 20→15 (covers full Opening Day slate)
- Add event-ID dedup guard before each per-event request
- Track 429s specifically in per-event except block
- Replace final log with SUMMARY line (events_returned/attempted/rate_limited/rows)
- Fix render_props fallback: remove `not raw_props.empty` guard so cached empty
results are not bypassed, eliminating uncached re-fetch on every Streamlit rerun

Live path (Dashboard):
- Replace aggregate /odds endpoint (422 on player props) with two-step per-event
approach: GET /events (commenceTimeFrom=now-6h to capture live games) → match
teams via _canon_team → GET /events/{id}/odds with regions=us + requested markets
- Function signature and row dict schema unchanged; all callers unaffected

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

2 files changed +123 -58
Files changed (2)
data/provider_theoddsapi.py+120-56
visualization/props_page.py+3-2