Skip to content

Issue with resolving Player collection in League object #85

Description

@hrobb

An issue is coming up when leveraging the filtering functionality for player collections within a League. While some categories (no filter, taken, free agents) seem to work fine, two other ones (all available, waivers) seem to run into an issue whereby, when combing through a set of 25, always towards the end of the result set, will hit a string that just says "player_key" instead of the expected dictionary representing players. This causes a runtime error on from_response_object since it isn't a dictionary.

I'm not sure if this is a change Yahoo made or something, but all filters were working fine last season.

Here is the stack trace:

    available_players = self.league.players('A')
                        ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.../venv/lib/python3.11/site-packages/yahoofantasy/resources/league.py", line 84, in players
    from_response_object(p, player)
  File "/.../venv/lib/python3.11/site-packages/yahoofantasy/api/parse.py", line 47, in from_response_object
    raise RuntimeError("Cannot parse response object that isn't dict")
RuntimeError: Cannot parse response object that isn't dict

And here is some debug code (line 79 of resources/league.py) and it's respective output to further illustrate the issue:

Image Image

(All ordered dictionaries until it tries to process the string)

I'm almost certain this is happening with the very last result set it's trying to process; the log returns what looks to be nearly all expected results until the very end. So I'm unsure if Yahoo is just tagging the last "incomplete" set of 25 with "player_key" fillers, or the end results aren't being queried correctly, or what the case is. This is further complicated given that the unfiltered, and about half of the filters return results without issue.

This is all after clearing the cache to make sure that wasn't causing issues.

If you need any further information from me please let me know.

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