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

[Bug]: Class - PlayerPositionAbbreviationNullable in nba_api/docs/nba_api/stats/library/paramters.md is not working #427

Open
girishm010 opened this issue Feb 15, 2024 · 4 comments
Assignees
Labels
bug Something isn't working triage Researching into a possible bug

Comments

@girishm010
Copy link

NBA API Version

V1.4.1

Issue

Only some of the abbreviations for player positions are working. Of these"(F)|(C)|(G)|(C-F)|(F-C)|(F-G)|(G-F)) only C, G, and F are valid.

Variable Name Value
none default  
center C
center_forward C-F
forward F
forward_center F-C
forward_guard F-G
guard G
guard_forward G-F

When the code is run with the others I am met with this response:

season_game_stats = LeagueDashTeamStats(
File "/Users/…/miniforge3/lib/python3.9/site-packages/nba_api/stats/endpoints/leaguedashteamstats.py", line 173, in init
self.get_request()
File "/Users/…/miniforge3/lib/python3.9/site-packages/nba_api/stats/endpoints/leaguedashteamstats.py", line 183, in get_request
self.load_response()
File "/Users/…/miniforge3/lib/python3.9/site-packages/nba_api/stats/endpoints/leaguedashteamstats.py", line 186, in load_response
data_sets = self.nba_response.get_data_sets()
File "/Users/…/miniforge3/lib/python3.9/site-packages/nba_api/stats/library/http.py", line 129, in get_data_sets
results = raw_dict["resultSet"]
KeyError: 'resultSet'

Code

season_game_stats = LeagueDashTeamStats(
    measure_type_detailed_defense='Opponent',
    per_mode_detailed='PerGame',
    player_position_abbreviation_nullable=‘F-C',
    season='2023-24',
)

@girishm010 girishm010 added bug Something isn't working triage Researching into a possible bug labels Feb 15, 2024
@rsforbes rsforbes self-assigned this Feb 15, 2024
@girishm010
Copy link
Author

Also as a follow-up, can we get PF (power forward), PG (point guard) and SF (small forward) abbreviations to work? Or do the (C-F)|(F-C)|(F-G)|(G-F) correspond to the positions I mentioned above?

@rsforbes
Copy link
Collaborator

rsforbes commented Feb 15, 2024 via email

@Kingvic
Copy link

Kingvic commented Nov 13, 2024

NBA limited their data to only support the following positions: C,F,G

@rsforbes
Copy link
Collaborator

Great call out! There are a number of stats that have improved over the years, including the values to pull them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Researching into a possible bug
Projects
None yet
Development

No branches or pull requests

3 participants