Skip to content

Fix Wyscout V2 deserializer: extra-time periods, final-event shots, n… - #613

Open
muhadkprsnl wants to merge 1 commit into
PySport:masterfrom
muhadkprsnl:fix/wyscout-v2-deserializer-609
Open

Fix Wyscout V2 deserializer: extra-time periods, final-event shots, n…#613
muhadkprsnl wants to merge 1 commit into
PySport:masterfrom
muhadkprsnl:fix/wyscout-v2-deserializer-609

Conversation

@muhadkprsnl

Copy link
Copy Markdown

…ull roster entries

Fixes #609

  • Extract period ID parsing into shared wyscout_periods.py module to handle extra-time ('E1', 'E2') and penalty ('P') period codes that were crashing the int() conversion in V2 deserializer (10 affected matches).

  • Guard next_event access in _parse_shot() with 'if next_event:' check to handle shots that are the last event in a match (6 affected matches).

  • Filter null entries from team roster lists in _parse_team() to handle malformed upstream data where players array contains null values (22 affected matches).

  • Add comprehensive regression tests in pr_609 directory covering all three fixes plus the _parse_set_piece path for free-kick shots as final event.

All existing Wyscout tests pass. All 4 real failing match IDs from the public open dataset now load successfully.

…ull roster entries

Fixes PySport#609

- Extract period ID parsing into shared wyscout_periods.py module to handle
  extra-time ('E1', 'E2') and penalty ('P') period codes that were crashing
  the int() conversion in V2 deserializer (10 affected matches).

- Guard next_event access in _parse_shot() with 'if next_event:' check to
  handle shots that are the last event in a match (6 affected matches).

- Filter null entries from team roster lists in _parse_team() to handle
  malformed upstream data where players array contains null values
  (22 affected matches).

- Add comprehensive regression tests in pr_609 directory covering all three
  fixes plus the _parse_set_piece path for free-kick shots as final event.

All existing Wyscout tests pass. All 4 real failing match IDs from the
public open dataset now load successfully.
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

Successfully merging this pull request may close these issues.

Wyscout V2 deserializer: 38 of 1941 matches in the public open dataset fail to load

1 participant