fix: off by one error when returning list of seasons#29
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adjusts the season listing logic by changing the iteration bounds when generating past season dates.
Changes:
- Updated the loop range in
list_seasonsto iterate over fewer months (exclusive upper bound).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| last = min(last, 1000) | ||
| dates = [] | ||
| for x in range(0, last + 1): | ||
| for x in range(0, last): |
Member
|
Yea this is a fine change, I'll merge tonight, thanks |
MagicTheDev
approved these changes
May 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently list/seasons returns a list of length last + 1. (last is the arg given for the number of seasons)
I believe that it makes most sense that this endpoint should return a list that is the length of last and not last + 1. For example, if I want a list of the last 4 seasons I should enter 4 as last, not 3.
I understand that this might cause some issues with projects built on using this endpoint but this change makes most sense from a pure functionality point of view, in my own opinion.