Skip to content

Commit 14173df

Browse files
committed
Remove extraneouse if and try-except blocks
1 parent b02f9f3 commit 14173df

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

python-package/itscalledsoccer/client.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -212,11 +212,7 @@ def _single_request(self, url: str, params: Dict[str, List[str]]) -> pd.DataFram
212212
:param params: URL query strings
213213
:returns: Dataframe
214214
"""
215-
try:
216-
response = self.session.get(url=url,params=params)
217-
response.raise_for_status()
218-
except requests.exceptions.HTTPError as err:
219-
print(err)
215+
response = self.session.get(url=url, params=params)
220216

221217
resp_df = pd.read_json(json.dumps(response.json()))
222218
return resp_df
@@ -327,14 +323,10 @@ def get_games(
327323

328324
if game_ids:
329325
query["game_id"] = game_ids
330-
331-
if team_ids and team_names:
332-
query["team_id"] = team_ids + self._convert_names_to_ids("team",team_names)
333-
elif team_names:
326+
if team_names:
334327
query["team_id"] = self._convert_names_to_ids("team",team_names)
335-
elif team_ids:
328+
if team_ids:
336329
query["team_id"] = team_ids
337-
338330
if seasons:
339331
query["season_name"] = seasons
340332
if stages:

0 commit comments

Comments
 (0)