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

Stat ID Map Not Populated in League Resource #55

Open
JustinMarinelli opened this issue Dec 3, 2024 · 2 comments · May be fixed by #57
Open

Stat ID Map Not Populated in League Resource #55

JustinMarinelli opened this issue Dec 3, 2024 · 2 comments · May be fixed by #57

Comments

@JustinMarinelli
Copy link

It seems like it would make sense for a League to have its stats_id_map property populated upon initialization. That is, after a call to yahoo_fantasy_api.League(oauth, '{{league_id}}'). This is not currently the case, and instead, a call to League.stats_id_map returns None immediately after initialization. Due to this issue, it's difficult to display stats on a UI consuming data returned from a call to League.matchups() in a human-friendly format.

A workaround I've found is to make a call to the League's _cache_stats_id_map() method before trying to access League.stats_id_map. However, due to _cache_stats_id_map being prefixed with a "_", it seems to suggest that this method should be used ONLY internally by the yahoo_fantasy_api library.

The ideal behavior to me would be that this map is populated upon initialization of a League.

@DMcP89
Copy link
Collaborator

DMcP89 commented Jan 1, 2025

@spilchen I would agree here. We should be populating everything possible with the initial call. I can get a PR going for this if you like.

@spilchen
Copy link
Owner

spilchen commented Jan 2, 2025

Yeah, I agree. This makes sense to do.

@DMcP89 DMcP89 linked a pull request Jan 23, 2025 that will close this issue
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 a pull request may close this issue.

3 participants