mirror of
https://github.com/probberechts/soccerdata.git
synced 2026-04-25 18:15:58 +03:00
[GH-ISSUE #703] Club names and aliases not correctly mapped at teamname_replacements.json #148
Labels
No labels
ESPN
FBref
FotMob
MatchHistory
SoFIFA
Sofascore
WhoScored
WhoScored
bug
build
common
dependencies
discussion
documentation
duplicate
enhancement
good first issue
invalid
performance
pull-request
question
question
removal
understat
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/soccerdata#148
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MartiONE on GitHub (Sep 12, 2024).
Original GitHub issue: https://github.com/probberechts/soccerdata/issues/703
Describe the bug
The bug appears when you try to call
read_team_historyfrom ClubElo. The file that contains aliases for team names that might differ from the ClubElo website gets correctly loaded and stored inside the_config.pyvariableTEAMNAME_REPLACEMENTS.However, whenever the function
read_team_historyinside the ClubElo class tries to filter the names to process does it in the reverse way, the problematic line is this oneAffected scrapers
This affects the following scrapers:
Code example
Considering you have a minimal
teamname_replacements.jsonlike{"Tottenham": ["Tottenham Hotspur", "Tottenham Hotspur FC", "Spurs"]}and then you run
Error message
Additional context
The same scenario can be also happenning in more dedicated classes, I did not check in depth: Here, here and here
Contributor Action Plan
This is a trivial change but an important one, I can also fix the tests or make them check the file. Also, I'd suggest we don't use one liners with variables like
kandvas those tend to be hard to debug.@MartiONE commented on GitHub (Sep 16, 2024):
Hey @probberechts , am I in the clear to provide a fix for this? :)
@probberechts commented on GitHub (Oct 10, 2024):
Great catch! It would be great if you provide a fix.