Skip to content

Commit

Permalink
Allow missing "game_day" in MA3 feeds (#583)
Browse files Browse the repository at this point in the history
The "game_day" field is not provided for all tournaments in Stats Perform feeds.

Co-authored-by: Raf Hermans <raf.hermans4@gmail.com>
  • Loading branch information
probberechts and rafhermans4 authored Sep 9, 2023
1 parent 288c90a commit 72aca85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion socceraction/data/opta/parsers/ma3_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def extract_games(self) -> Dict[str, Dict[str, Any]]:
game_id=game_id,
season_id=assertget(season, "id"),
competition_id=assertget(competition, "id"),
game_day=int(assertget(match_info, "week")),
game_day=int(match_info["week"]) if "week" in match_info else None,
game_date=datetime.strptime(game_datetime, "%Y-%m-%dT%H:%M:%S"),
home_team_id=self._extract_team_id(contestant, "home"),
away_team_id=self._extract_team_id(contestant, "away"),
Expand Down

0 comments on commit 72aca85

Please sign in to comment.