Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: Could not find a game with that id still occurring -- worked yesterday #148

Open
ghost opened this issue Jan 27, 2022 · 1 comment

Comments

@ghost
Copy link

ghost commented Jan 27, 2022

Just getting started with this API, and this morning am seeing the same game id error still occuring. This happens with running the base example presented in the documentation. Anyone have a fix?

`#!python
from future import print_function
import mlbgame

game = mlbgame.day(2015, 11, 1, home='Mets')[0]
stats = mlbgame.player_stats(game.game_id)
for player in stats.home_batting:
print(player)`

@tomdmason
Copy link

I am also getting some similar inconsistent results:

mlbGames = mlbgame.day(2018, 4, 10)
print(mlbGames[0].game_id)
print(vars(mlbgame.box_score(mlbGames[0].game_id)))
print(vars(mlbgame.overview(mlbGames[0].game_id)))

Output:

2018_04_10_tbamlb_chamlb_1
{'game_id': '2018_04_10_tbamlb_chamlb_1', 'innings': [{'inning': 1, 'home': 0, 'away': 0}, {'inning': 2, 'home': 0, 'away': 0}, {'inning': 3, 'home': 0, 'away': 2}, {'inning': 4, 'home': 0, 'away': 1}, {'inning': 5, 'home': 1, 'away': 1}, {'inning': 6, 'home': 0, 'away': 1}, {'inning': 7, 'home': 0, 'away': 0}, {'inning': 8, 'home': 0, 'away': 0}, {'inning': 9, 'home': 4, 'away': 1}]}
Could not find a game with that id.

So game id is valid for the boxscore call, but not the overview

ikeyoda added a commit to ikeyoda/mlbgame that referenced this issue Jan 29, 2022
Doesn't access raw box score if raw score doesn't exist
ikeyoda added a commit to ikeyoda/mlbgame that referenced this issue Jan 29, 2022
Checks if raw box score exists, and if not, avoids accessing additional stats to avoid error
This was referenced Jan 29, 2022
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

No branches or pull requests

1 participant