Fix Wyscout V2 deserializer: extra-time periods, final-event shots, n… - #613
Open
muhadkprsnl wants to merge 1 commit into
Open
Fix Wyscout V2 deserializer: extra-time periods, final-event shots, n…#613muhadkprsnl wants to merge 1 commit into
muhadkprsnl wants to merge 1 commit into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…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.