andrewRowlinson / mplsoccer

Football pitch plotting library for matplotlib
MIT License
405 stars 82 forks source link

Version 1.0.7 - Bug while getting a match (competitionId: 16, seasonId: 76) - KeyError: 'match_date' #56

Closed pakkk closed 2 years ago

pakkk commented 2 years ago

Hi Andrew,

I have the following error with your 1.0.7 version while getting a match (competitionId: 16, seasonId: 76):

from mplsoccer import Sbopen parser = Sbopen(dataframe=True) matches = parser.match(16, 76)

KeyError: 'match_date'

The stack trace shows that the line 409 is involved in the exception:

File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/mplsoccer/statsbomb.py", line 409, in _match_dataframe

Do you know what is wrong?

Thanks again :)

Cheers, Paco.

andrewRowlinson commented 2 years ago

Thanks for noticing. This is because these files are blank jsons (empty lists). I'll try and fix it. I updated the branch version number to 1.1.0.

Andy

andrewRowlinson commented 2 years ago

Fixed with commit 46c71302b1a9f778bb4fa91658ae507f23813324. I also renamed the branch: https://github.com/andrewRowlinson/mplsoccer/tree/update_1_1_0

The docs are currently here: https://mplsoccer.readthedocs.io/en/update_1_1_0/index.html. There are a few new features like turbine charts.

andrewRowlinson commented 2 years ago

I've released this update now on pypi.