Comments (2)
Check this out: https://github.com/joeyagreco/leeger/blob/main/example/league_loader/nameChanges.py
from leeger.
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):
File "/Users/ryan.gillies/Documents/side_judge/backend/models/league.py", line 91, in _load_leeger
leagueStats: AllTimeStatSheet = leagueStatSheet(leeger, validate = True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ryan.gillies/Documents/side_judge/.venv/lib/python3.11/site-packages/leeger/util/stat_sheet.py", line 81, in leagueStatSheet
maxScoringShare = ScoringShareAllTimeCalculator.getMaxScoringShare(league, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ryan.gillies/Documents/side_judge/.venv/lib/python3.11/site-packages/leeger/decorator/validators.py", line 38, in wrapFunction
return function(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ryan.gillies/Documents/side_judge/.venv/lib/python3.11/site-packages/leeger/calculator/all_time_calculator/ScoringShareAllTimeCalculator.py", line 143, in getMaxScoringShare
maxScoringSharesByYear[yearNumber][ownerId]
KeyError: '506256e003f911efba5b5af986bf8fed'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
Code
def _load_leeger(self):
from leeger.league_loader import SleeperLeagueLoader
from leeger.model.league import League, Year
from leeger.model.stat.YearStatSheet import YearStatSheet
from leeger.util.stat_sheet import yearStatSheet, leagueStatSheet
from leeger.model.stat.AllTimeStatSheet import AllTimeStatSheet
league_loader = SleeperLeagueLoader(self.league_id, self.years)
leeger: League = league_loader.loadLeague()
from leeger.model.stat.AllTimeStatSheet import AllTimeStatSheet
from leeger.util.stat_sheet import leagueStatSheet
try:
leagueStats: AllTimeStatSheet = leagueStatSheet(leeger, validate = True)
except KeyError:
import traceback
traceback.print_exc()
return leeger
from leeger.
Related Issues (14)
- [LEAGUE LOADER]: Running ESPN example gives TypeError: dataclass() got an unexpected keyword argument 'kw_only' HOT 1
- [LEAGUE LOADER]: IndexError: list index out of range in __buildWeeks HOT 13
- [LEAGUE LOADER]: Yahoo league loader unable to find more than 1 league year HOT 1
- [LEAGUE LOADER]: Yahoo league loader fails when it incorrectly detects 2 championship matchups HOT 1
- [FEATURE]: Franchise history and individual user history for all time stats HOT 2
- [FEATURE]: Add Support for Multi-Week Matchups
- [LEAGUE LOADER]: Fails on TypeError HOT 1
- [LEAGUE LOADER]: AttributeError: 'Matchup' object has no attribute 'winner_team_key' HOT 5
- [LEAGUE LOADER]: AttributeError: 'Matchup' object has no attribute 'winner_team_key' HOT 14
- [LEAGUE LOADER]: Fleaflicker support HOT 3
- [LEAGUE LOADER]: Could not find league for year 2022 with ID HOT 1
- [LEAGUE LOADER]: Dealing with changed ownership HOT 1
- Excel Color Map Raising Error HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from leeger.