Closed enjoymoreradio closed 9 months ago
I just tested this again and it's working for the 2024 season now. It appears the season record was created, and then later the players were associated with the new season.
Nevertheless, I am updating statsapi.latest_season()
to return the current season if one is active based on seasonStartDate
and seasonEndDate
, otherwise the true latest season. I think this is the expected behavior. This will be in version 1.7.
Related to this discussion in the subreddit. When a season parameter is not specified when calling lookup_player, the function calls latest_season() as a fallback.
latest_season() makes a request to the API for a list of all seasons, and returns the last item in the list
This works unless and until MLB adds a season that has not yet started to their database, as they recently did with 2024. The latest_season() function should return 2023 at least until the conclusion of 2023 World Series, if not later.