You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running the command yahoofantasy dump -g nhl -s 2023 -o ./data/nhl-2023-performances.csv performances for my recently completed NHL league. All other dump commands are working fine, but this one raises
WARN: Failed to fetch week 1 stats for Aleksander Barkov (427.p.5981), trying again in 2 minutes
I thought it might some kind of ratelimit, but when I throw a breakpoint in, the traceback is as follows:
Traceback (most recent call last):
File ".../venv/lib/python3.11/site-packages/yahoofantasy/cli/dump.py", line 54, in _player_out
for stat in player.get_stats(week_num):
^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../venv/lib/python3.11/site-packages/yahoofantasy/resources/player.py", line 23, in get_stats
stats_data = self._fetch_stats(week_num)["player_stats"]
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
KeyError: 'player_stats'
I believe the error is happening inside the player.get_stats(week_num) call inside _player_out. I didn't dig any further but can give a hand if needed.
The text was updated successfully, but these errors were encountered:
I'm not a part of an NHL fantasy league so it's a bit hard for me to test. But it looks like your suspicion is correct, this is likely not due to rate limiting but is indeed some kind of bug. I wonder if the stat data comes back differently for NHL leagues? A bit surprised this wouldn't have been reported before though.
Try this snippet and see if you can see what the stats data object looks like for a player, this might lead to some hints
I am running the command
yahoofantasy dump -g nhl -s 2023 -o ./data/nhl-2023-performances.csv performances
for my recently completed NHL league. All other dump commands are working fine, but this one raisesI thought it might some kind of ratelimit, but when I throw a breakpoint in, the traceback is as follows:
I believe the error is happening inside the
player.get_stats(week_num)
call inside_player_out
. I didn't dig any further but can give a hand if needed.The text was updated successfully, but these errors were encountered: