-
Notifications
You must be signed in to change notification settings - Fork 17
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
Sleeper League Loader (Key Error) #116
Comments
I'm also getting a key error when trying to compile an all-time statsheet from Sleeper. I don't have any users that changed usernames, but do have several owners leaving and new owners from one year to the next. Error Logs Traceback (most recent call last): Code
|
League Loader
Sleeper
Summary
When I try the basic "quick start" for loading in a sleeper league, I get a KeyError: 7. Will post the full log below. Wondering if it has to do with a team that the owner was removed and is now just an NPC team. Also, sorry if this is mentioned somewhere in the README or anything, I wasn't able to find it.
League Info
League ID: 1000931507806011392
Season: 2023
Error Logs
KeyError Traceback (most recent call last)
Cell In[8], line 2
1 sleeperLeagueLoader = SleeperLeagueLoader("1000931507806011392", [2023])
----> 2 League = sleeperLeagueLoader.loadLeague()
File ~\anaconda3\envs\py36\Lib\site-packages\leeger\league_loader\SleeperLeagueLoader.py:121, in SleeperLeagueLoader.loadLeague(self, validate)
119 def loadLeague(self, validate: bool = True) -> League:
120 sleeperLeagues = self.__getAllLeagues()
--> 121 league = self.__buildLeague(sleeperLeagues)
122 if validate:
123 # validate new league
124 leagueValidation.runAllChecks(league)
File ~\anaconda3\envs\py36\Lib\site-packages\leeger\league_loader\SleeperLeagueLoader.py:136, in SleeperLeagueLoader.__buildLeague(self, sleeperLeagues)
133 for sleeperLeague in sleeperLeagues:
134 # save league name for each year
135 self._leagueNameByYear[int(sleeperLeague.season)] = sleeperLeague.name
--> 136 years.append(self.__buildYear(sleeperLeague))
137 return League(name=self._getLeagueName(), owners=owners, years=self._getValidYears(years))
File ~\anaconda3\envs\py36\Lib\site-packages\leeger\league_loader\SleeperLeagueLoader.py:147, in SleeperLeagueLoader.__buildYear(self, sleeperLeague)
143 self._sleeperDivisionIdToDivisionMap[divisionNumber] = Division(
144 name=getattr(sleeperLeague.metadata, f"division{divisionNumber}")
145 )
146 teams = self.__buildTeams(sleeperLeague)
--> 147 weeks = self.__buildWeeks(sleeperLeague)
148 # add YearSettings
149 yearSettings = YearSettings()
File ~\anaconda3\envs\py36\Lib\site-packages\leeger\league_loader\SleeperLeagueLoader.py:192, in SleeperLeagueLoader.__buildWeeks(self, sleeperLeague)
189 for sleeperMatchupPair in sleeperMatchupIdToSleeperMatchupMap.values():
190 # team A
191 teamASleeperMatchup = sleeperMatchupPair[0]
--> 192 teamA = self.__sleeperRosterIdToTeamMap[teamASleeperMatchup.roster_id]
194 # team B
195 teamBSleeperMatchup = sleeperMatchupPair[1]
KeyError: 7
The text was updated successfully, but these errors were encountered: