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

feat: Add previousSeasons to BaseLeague object #509

Merged
merged 2 commits into from
Dec 5, 2023

Conversation

DesiPilla
Copy link
Contributor

Add a list of all previous seasons for a league. I know this is accurate for football leagues, and I assume(?) this is the same across all ESPN leagues and should be a part of the BaseLeague object.

Add a list of all previous seasons for a league. I know this is accurate for football leagues, and I assume(?) this is the same across all ESPN leagues and should be a part of the `BaseLeague` object.
@codecov-commenter
Copy link

codecov-commenter commented Dec 4, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (cff22b5) 80.57% compared to head (8f9a834) 80.58%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #509   +/-   ##
=======================================
  Coverage   80.57%   80.58%           
=======================================
  Files          59       59           
  Lines        2111     2112    +1     
=======================================
+ Hits         1701     1702    +1     
  Misses        410      410           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@DesiPilla DesiPilla changed the title feat: Add previousSeasons to League object feat: Add previousSeasons to BaseLeague object Dec 4, 2023
@DesiPilla
Copy link
Contributor Author

An interesting note about ESPN's API on this matter:

Say you have a league that has been around since 2017.

  • For currently active leagues (2023 right now), the previousSeasons will return the expected result: [2017, 2018, 2019, 202, 2021, 2022], all the years prior to the current year.
  • For the most recent completed season (2022 in this case), the previousSeasons will return the expected result: [2017, 2018, 2019, 2020, 2021], all the years prior to the given league year.
  • However, for all other completed years, the same result is returned. For example, even if you query for the year 2018, you would expect to get [2017], but the API will return [2017, 2018, 2019, 2020, 2021] instead.

@DesiPilla
Copy link
Contributor Author

Updated the PR to only include seasons prior to the one being queried.

@DesiPilla
Copy link
Contributor Author

@cwendt94 this PR is ready to be merged.

@cwendt94 cwendt94 merged commit 2ccb6b7 into cwendt94:master Dec 5, 2023
3 checks passed
@DesiPilla DesiPilla deleted the add-previous-seasons branch December 5, 2023 16:32
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.

3 participants