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

[Common] Incorrect default seasons #740

Open
9 tasks done
MimmoScogna opened this issue Oct 30, 2024 · 2 comments
Open
9 tasks done

[Common] Incorrect default seasons #740

MimmoScogna opened this issue Oct 30, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@MimmoScogna
Copy link

MimmoScogna commented Oct 30, 2024

Describe the bug
Despite the latest update, you can't get the data for the 2024/25 season, the loaded seasons in fact always stop at 2023/24

Affected scrapers
This affects the following scrapers:

  • ClubElo
  • ESPN
  • FBref
  • FiveThirtyEight
  • FotMob
  • Match History
  • SoFIFA
  • Understat
  • WhoScored

Test Code

import soccerdata as sd
import pandas as pd
understat = sd.Understat(leagues="ITA-Serie A")
seasons = understat.read_seasons()
seasons
image
@MimmoScogna MimmoScogna added the bug Something isn't working label Oct 30, 2024
@MimmoScogna MimmoScogna changed the title [Understat] [Understat] Season 2024/25 not available Oct 30, 2024
@probberechts
Copy link
Owner

Thanks. This is a bug in the code that sets the default seasons.

if seasons is None:
logger.info("No seasons provided. Will retrieve data for the last 5 seasons.")
year = datetime.now(tz=timezone.utc).year
seasons = [f"{y - 1}-{y}" for y in range(year, year - 6, -1)]

If you explicitly provide the seasons for which you want to retrieve data, it works.

understat = sd.Understat(leagues="ITA-Serie A", seasons="24/25", no_cache=True)

@probberechts probberechts changed the title [Understat] Season 2024/25 not available [Common] Incorrect default seasons Oct 30, 2024
@MimmoScogna
Copy link
Author

Thanks! It works good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants