meraki-analytics / cassiopeia

An all-inclusive Python framework for the Riot Games League of Legends API. Cass focuses on making the data easy and fun to work with, while providing all the tools necessary to create a website or do data analysis.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

self.stat_runes = [
seems to fix the problem for me.

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.