I encounter an error in ESPN.py (Python Version: 3.11.7; OS: Windows: 11; soccerdata: 1.5.3):
<path>\.venv\Lib\site-packages\soccerdata\fbref.py:674: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.
pd.concat(schedule)
[02/12/24 18:48:52] INFO No lineup info found for team 1 in game with ID=671269 espn.py:262
INFO No lineup info found for team 2 in game with ID=671269 espn.py:262
Traceback (most recent call last):
File "<path>main.py", line 258, in <module>
main()
File "<path>main.py", line 84, in main
lineups = espn.read_lineup(match_id=copy.values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<path>.venv\Lib\site-packages\soccerdata\espn.py", line 300, in read_lineup
ii = [i for i, x in enumerate(p["plays"]) if x["substitution"]][j]
~^^^^^^^^^
KeyError: 'plays'
I am retrieving all the lineups and in match. The issue occurs in match 643973. The Problem is the Structur of one players Data that looks as follows:
Especially this Part is odd: 'subbedOut': {'didSub': False} in other Playersdata this is directly a boolean and there are no sub fields. My solution is now to change ESPN.py at line 298 as follows: elif p["subbedOut"] and isinstance(p["subbedOut"], bool):
I recognized the same error for subbedIn as well. So i changed line 282 as well: elif p["subbedIn"] and isinstance(p["subbedIn"], bool):
I encounter an error in ESPN.py (Python Version: 3.11.7; OS: Windows: 11; soccerdata: 1.5.3):
I am retrieving all the lineups and in match. The issue occurs in match 643973. The Problem is the Structur of one players Data that looks as follows:
Especially this Part is odd:
'subbedOut': {'didSub': False}
in other Playersdata this is directly a boolean and there are no sub fields. My solution is now to change ESPN.py at line 298 as follows:elif p["subbedOut"] and isinstance(p["subbedOut"], bool):
I recognized the same error for subbedIn as well. So i changed line 282 as well:
elif p["subbedIn"] and isinstance(p["subbedIn"], bool):
Does someone has a better solution?