Jon Solow
commited on
Commit
·
a35d669
1
Parent(s):
5e1c682
Add a try-except if issue shows up where a home team id is just empty string
Browse files- src/stats.py +6 -2
src/stats.py
CHANGED
@@ -368,8 +368,12 @@ def get_yahoo_schedule() -> dict[int, dict[str, dict[str, str | int | pd.Timesta
|
|
368 |
for game_id, game in games_json.items():
|
369 |
if not game_id.split(".")[0] == "nfl":
|
370 |
continue
|
371 |
-
|
372 |
-
|
|
|
|
|
|
|
|
|
373 |
|
374 |
if "week_number" not in game:
|
375 |
continue
|
|
|
368 |
for game_id, game in games_json.items():
|
369 |
if not game_id.split(".")[0] == "nfl":
|
370 |
continue
|
371 |
+
try:
|
372 |
+
# sometimes yahoo has issue where home_team_id is ''
|
373 |
+
away_team = team_id_to_abbr[game["away_team_id"]]
|
374 |
+
home_team = team_id_to_abbr[game["home_team_id"]]
|
375 |
+
except KeyError:
|
376 |
+
continue
|
377 |
|
378 |
if "week_number" not in game:
|
379 |
continue
|