soccerdata icon indicating copy to clipboard operation
soccerdata copied to clipboard

[Common] Incorrect default seasons

Open MimmoScogna opened this issue 1 year ago • 2 comments

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:

  • [X] ClubElo
  • [X] ESPN
  • [X] FBref
  • [X] FiveThirtyEight
  • [X] FotMob
  • [X] Match History
  • [X] SoFIFA
  • [X] Understat
  • [X] 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 avatar Oct 30 '24 18:10 MimmoScogna

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

https://github.com/probberechts/soccerdata/blob/4cf2debc2d4946be86ea6decdbe9d87380119cb8/soccerdata/_common.py#L474-L477

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 avatar Oct 30 '24 19:10 probberechts

Thanks! It works good

MimmoScogna avatar Oct 30 '24 23:10 MimmoScogna