position_type KeyError
I just ran a script for the first time in six months and I'm getting this error whenever calling roster
~/anaconda3/lib/python3.8/site-packages/yahoo_fantasy_api/team.py in roster(self, week, day)
93 plyr["position_type"] = next_item["position_type"]
94 else:
---> 95 plyr["position_type"] = next(it)["position_type"]
96 plyr["eligible_positions"] = _compact_eligible_pos(next(it))
97 plyr["selected_position"] = _compact_selected_pos(next(it))
KeyError: 'position_type'
@ryanlaughlin can you post the script you are running or provide a link to it?
I ran into this same issue trying to get rosters from a fantasy football league. I discovered that the objectpath filter was pulling a {status: False} for each player in addition to a player's status on injury, suspension, etc.
I resolved the issue by redefining the 'it' variable after Lines 71-73 as follows: it = iter([item for item in it if item != {'status': False}])
I ran into this same issue trying to get rosters from a fantasy football league. I discovered that the objectpath filter was pulling a {status: False} for each player in addition to a player's status on injury, suspension, etc.
I resolved the issue by redefining the 'it' variable after Lines 71-73 as follows: it = iter([item for item in it if item != {'status': False}])
Ah, now that I cloned the repo I see this was only a problem in my original installation and has since been resolved. Thanks!