Skip to content

Commit cd0bbcc

Browse files
committed
fix: Remove problematic type hints from extractor methods
Removed return type annotations (-> sd.ClassName) from all _get_*_reader methods across all 9 extractors. These type hints were causing AttributeError at import time because soccerdata module doesn't expose these classes as direct module attributes. Fixed extractors: - fbref_extractor.py - fotmob_extractor.py - understat_extractor.py - whoscored_extractor.py - sofascore_extractor.py - espn_extractor.py - clubelo_extractor.py - matchhistory_extractor.py - sofifa_extractor.py This resolves: AttributeError: module 'soccerdata' has no attribute 'FotMob'
1 parent c7e0c44 commit cd0bbcc

File tree

9 files changed

+9
-9
lines changed

9 files changed

+9
-9
lines changed

scripts/extractors/clubelo_extractor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def extract_data(
6363
method = getattr(self, extraction_method)
6464
return method(league, season)
6565

66-
def _get_clubelo_reader(self) -> sd.ClubElo:
66+
def _get_clubelo_reader(self):
6767
"""Get configured ClubElo reader instance"""
6868
return sd.ClubElo()
6969

scripts/extractors/espn_extractor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def extract_data(
6969
method = getattr(self, extraction_method)
7070
return method(league, season)
7171

72-
def _get_espn_reader(self, league: str, season: str) -> sd.ESPN:
72+
def _get_espn_reader(self, league: str, season: str):
7373
"""Get configured ESPN reader instance"""
7474
soccerdata_league = self.get_soccerdata_league_id(league)
7575

scripts/extractors/fbref_extractor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def extract_data(
189189
else:
190190
return method(league, season)
191191

192-
def _get_fbref_reader(self, league: str, season: str) -> sd.FBref:
192+
def _get_fbref_reader(self, league: str, season: str):
193193
"""
194194
Get configured FBref reader instance
195195

scripts/extractors/fotmob_extractor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def extract_data(
134134
else:
135135
return method(league, season)
136136

137-
def _get_fotmob_reader(self, league: str, season: str) -> sd.FotMob:
137+
def _get_fotmob_reader(self, league: str, season: str):
138138
"""
139139
Get configured FotMob reader instance
140140

scripts/extractors/matchhistory_extractor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def extract_data(
5555
method = getattr(self, extraction_method)
5656
return method(league, season)
5757

58-
def _get_matchhistory_reader(self, league: str, season: str) -> sd.MatchHistory:
58+
def _get_matchhistory_reader(self, league: str, season: str):
5959
"""Get configured MatchHistory reader instance"""
6060
soccerdata_league = self.get_soccerdata_league_id(league)
6161

scripts/extractors/sofascore_extractor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def extract_data(
7575
method = getattr(self, extraction_method)
7676
return method(league, season)
7777

78-
def _get_sofascore_reader(self, league: str, season: str) -> sd.Sofascore:
78+
def _get_sofascore_reader(self, league: str, season: str):
7979
"""Get configured Sofascore reader instance"""
8080
soccerdata_league = self.get_soccerdata_league_id(league)
8181

scripts/extractors/sofifa_extractor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def extract_data(
9090
method = getattr(self, extraction_method)
9191
return method(league, season)
9292

93-
def _get_sofifa_reader(self, league: str) -> sd.SoFIFA:
93+
def _get_sofifa_reader(self, league: str):
9494
"""Get configured SoFIFA reader instance"""
9595
soccerdata_league = self.get_soccerdata_league_id(league)
9696

scripts/extractors/understat_extractor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def extract_data(
111111
method = getattr(self, extraction_method)
112112
return method(league, season)
113113

114-
def _get_understat_reader(self, league: str, season: str) -> sd.Understat:
114+
def _get_understat_reader(self, league: str, season: str):
115115
"""
116116
Get configured Understat reader instance
117117

scripts/extractors/whoscored_extractor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def extract_data(
8080
method = getattr(self, extraction_method)
8181
return method(league, season)
8282

83-
def _get_whoscored_reader(self, league: str, season: str) -> sd.WhoScored:
83+
def _get_whoscored_reader(self, league: str, season: str):
8484
"""Get configured WhoScored reader instance"""
8585
soccerdata_league = self.get_soccerdata_league_id(league)
8686

0 commit comments

Comments
 (0)