statPerk0 is not available for some matches and throws a KeyError
PeteyPii opened this issue · comments
Trying to create a match object from https://na1.api.riotgames.com/lol/match/v4/matches/2910707418 throws a KeyError. I suspect the problem is when runes were first reworked, we didn't have the little bonus stats at the bottom right of the rune page.
Adding an additional check to
cassiopeia/cassiopeia/core/match.py
Line 158 in 00f1521
The .pop(..., None)
should mean there is never a KeyError, and instead None
will be returned. Are you seeing something different?
If a user accesses the .stat_runes
attribute and the stat runes don't exist for that match, then throwing an error notifies the user of that. Using a try/except is likely the best way to handle that exception-case.
Ah you're right, it was fixed in 00f1521, I'm just using an older version.
Great, thanks for catching that.