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

get_all_star_box_score(2012) returns error #70

Closed
rudiejd opened this issue Jan 10, 2022 · 1 comment · Fixed by #71
Closed

get_all_star_box_score(2012) returns error #70

rudiejd opened this issue Jan 10, 2022 · 1 comment · Fixed by #71

Comments

@rudiejd
Copy link
Contributor

rudiejd commented Jan 10, 2022

Attempting to get the box score for the 2012 all-star game returns an error about out of range indexing for a player's last name

Code to reproduce:

from basketball_reference_scraper.box_score import get_all_star_box_score

print(get_all_star_box_score(2012))
Traceback (most recent call last):
  File "/home/jd/git/basketball_reference_scraper/test/test_box_scores.py", line 25, in test_get_all_star_box_score
    d = get_all_star_box_score(2012)
  File "/home/jd/git/basketball_reference_scraper/basketball_reference_scraper/box_scores.py", line 88, in get_all_star_box_score
    stats_df = get_stats(dnp, ask_matches=False)
  File "/home/jd/git/basketball_reference_scraper/basketball_reference_scraper/players.py", line 14, in get_stats
    suffix = get_player_suffix(name)
  File "/home/jd/git/basketball_reference_scraper/basketball_reference_scraper/utils.py", line 90, in get_player_suffix
    initial = last_name_part[0].lower()
IndexError: string index out of range
@rudiejd
Copy link
Contributor Author

rudiejd commented Jan 10, 2022

Looks like this is because get_player_suffix('Joe Johnson') is not working. Not sure if this worked before, but right now it's broken because makes a blank last name part of the suffix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant