New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KeyError: -1 when importing League #21
Comments
I am guessing because this is a dynasty league that if the player was carried over roundPickNumber does not exists |
It should be a easy fix but would be super helpfully if you could attach the data from the endpoint below for the league that it crashes on. replace "league_id" with your league number. This endpoint does not have any sensitive data. |
@kstreepy Perfect, thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm in 4 leagues. I received this error for 2 of the 4 leagues with the same lines indicated.
KeyError Traceback (most recent call last)
in
----> 1 league_dynasty_18 = League(dynasty_id, year18, espn_s2, swid)
~\Anaconda3\lib\site-packages\ff_espn_api\league.py in init(self, league_id, year, espn_s2, swid)
52 'SWID': self.swid
53 }
---> 54 self._fetch_league()
55
56 def repr(self):
~\Anaconda3\lib\site-packages\ff_espn_api\league.py in _fetch_league(self)
75 self._fetch_players()
76 self._fetch_teams()
---> 77 self._fetch_draft()
78
79 def _fetch_teams(self):
~\Anaconda3\lib\site-packages\ff_espn_api\league.py in _fetch_draft(self)
192 team = self.get_team_data(pick['teamId'])
193 playerId = pick['playerId']
--> 194 playerName = self.player_map[playerId]
195 round_num = pick['roundId']
196 round_pick = pick['roundPickNumber']
KeyError: -1
The text was updated successfully, but these errors were encountered: