Skip to content

Performances dump player_stats KeyError #69

@j-krl

Description

@j-krl

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions