Skip to content

Commit dc7a94c

Browse files
committed
fix: seriesStatus hydration error for 2014-03-11
1 parent 316c1bf commit dc7a94c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

statsapi/__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,20 @@ def schedule(
7474
if game_id:
7575
params.update({"gamePks": game_id})
7676

77+
hydrate = (
78+
"decisions,probablePitcher(note),linescore,broadcasts,game(content(media(epg)))"
79+
)
80+
if date == "2014-03-11" or (str(start_date) <= "2014-03-11" <= str(end_date)):
81+
# For some reason the seriesStatus hydration throws a server error on 2014-03-11 only (checked back to 2000)
82+
logger.warning(
83+
"Excluding seriesStatus hydration because the MLB API throws an error for 2014-03-11 which is included in the requested date range."
84+
)
85+
else:
86+
hydrate += ",seriesStatus"
7787
params.update(
7888
{
7989
"sportId": str(sportId),
80-
"hydrate": "decisions,probablePitcher(note),linescore,broadcasts,game(content(media(epg))),seriesStatus",
90+
"hydrate": hydrate,
8191
}
8292
)
8393

0 commit comments

Comments
 (0)