Skip to content
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

55 stat id map not populated in league resource #57

Conversation

DMcP89
Copy link
Collaborator

@DMcP89 DMcP89 commented Jan 23, 2025

Update to allow league objects to populate caches at instantiation

  • The two main changes here are allowing a handler to be passed to the constructor of the League object and calling certain functions to populate its caches. This has an added benefit of simplifying the fixtures for the unit tests slightly. If this is acceptable we can look to apply similar changes to the other classes.

closes #55

DMcP89 and others added 14 commits September 13, 2024 00:16
…er-stats

Enhancement/include points in player stats
…er-stats

Adjusting player stats to use league resource instead of player
…de-points-in-player-stats

Fixes by autopep8 action
…om:DMcP89/yahoo_fantasy_api into enhancement/include-points-in-player-stats
The two main changes here are allowing a handler to be passed to the
constructor of the League object and calling certain functions to
populate its caches. If this is acceptable we can look to apply similar
changes to the other classes.
@DMcP89 DMcP89 requested a review from spilchen January 23, 2025 03:26
@DMcP89 DMcP89 marked this pull request as ready for review January 24, 2025 04:41
@DMcP89
Copy link
Collaborator Author

DMcP89 commented Jan 25, 2025

@spilchen would like your input here before merging, any objections?

Copy link
Owner

@spilchen spilchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening the PR! Lets bump the version in setup.py to 2.10.1.

yahoo_fantasy_api/game.py Show resolved Hide resolved
yahoo_fantasy_api/league.py Show resolved Hide resolved
yahoo_fantasy_api/league.py Outdated Show resolved Hide resolved
@DMcP89
Copy link
Collaborator Author

DMcP89 commented Jan 29, 2025

@spilchen I have moved the function calls to populate the stats cache into the inject_yhandler function of the League class. This is the only way I can see to populate the cache at league creation as we need the yhandler in place for the call to settings().

The only alternative to this I can see is having the game code get passed into the league object, but that would require a lot more changes then this. Let me know what you think.

@DMcP89 DMcP89 force-pushed the 55-stat-id-map-not-populated-in-league-resource branch from 8570e15 to 8962602 Compare January 31, 2025 04:06
@DMcP89
Copy link
Collaborator Author

DMcP89 commented Jan 31, 2025

Should be good to go now @spilchen

Copy link
Owner

@spilchen spilchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just had a minor comment.

yahoo_fantasy_api/league.py Outdated Show resolved Hide resolved
@spilchen spilchen merged commit 72be91e into spilchen:master Feb 2, 2025
1 check passed
Repository owner deleted a comment Feb 4, 2025
Repository owner deleted a comment Feb 4, 2025
Repository owner deleted a comment Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stat ID Map Not Populated in League Resource
2 participants