Fix Schedule Bug
Updates:
-
Fixes bug in
schedulefunction. As it stands, theschedulefunction relies on ahydrateparameter:
hydrate = (
"decisions,probablePitcher(note),linescore,broadcasts,game(content(media(epg)))"
)
However, usage shows that including game(content(media(epg))) in the hydrate parameter creates unreliable behavior on calls to the schedule function, often leading to internal server errors from MLB's API:
The behavior appears to be stochastic, only occasionally resulting in a clean response from the MLB API.
However, removing game(content(media(epg))) entirely from the hydrate parameter appears to fix this issue.
-
Include
.ideain.gitignore. For those using pycharm IDE
@toddrob99 for viz
@elliottevans, does the error only happen when you use a large date range? It appears the API is returning a 500 Internal Server Error when its query times out. Postman won't show me the response size with the game(content(media(epg))) included for all of 2019 because it says it's too big, but even without the game(content(media(epg))) hydration, the response for all of 2019 is 20MB. For March 2019, the response is 2.63MB without the game(content(media(epg))) hydration and 4.65MB with it. The response for the first half of 2019 is 46MB with the hydration included and 11MB without it.
I'm sure removing the hydration makes the query complete faster because it's joining fewer tables. However, removing the hydration would be a breaking change for anyone expecting the media data to be included.
Instead, I suggest reducing the date range in your requests so they can complete in a timely manner.