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

LeagueGameFinder returns an empty data array #95

Closed
maxjaksa opened this issue Nov 10, 2019 · 5 comments
Closed

LeagueGameFinder returns an empty data array #95

maxjaksa opened this issue Nov 10, 2019 · 5 comments
Labels
question Inquiry from community

Comments

@maxjaksa
Copy link

Hi swar, thanks so much for creating this api! I am loving it.

So prior to the changes that occurred on stats.nba.com that forced your recent header changes (see: #94), I was using the LeagueGameFinder to pull down various bits of game data. When that change occurred I got the connection issue reported above.

After adding headers, I no longer get the connection issue, but the object returned from LeagueGameFinder doesn’t return any meaningful results (the league_game_finder_results.data array always comes up empty, regardless of the query/params). Any idea what might be causing this?

Sample LeagueGameFinder api call from my application (just in case I'm doing something terribly wrong):

raw_game_data = leaguegamefinder.LeagueGameFinder(date_from_nullable=start, date_to_nullable=end, league_id_nullable=LeagueIDNullable().nba, season_type_nullable=SeasonType().regular)

@swar
Copy link
Owner

swar commented Nov 10, 2019

What are you passing to start and end?

I just ran what you sent here without start and date_from_nullable and date_to_nullable and I was able to receive data.

from nba_api.stats.library.parameters import *
from nba_api.stats.endpoints import *

raw_game_data = leaguegamefinder.LeagueGameFinder(league_id_nullable=LeagueIDNullable().nba, season_type_nullable=SeasonType().regular)

@maxjaksa
Copy link
Author

Hi @swar, I'm just passing in strings formatted like so: "m/d/yyyy"

Example: start='10/6/2019', end'10/7/2019'

After some initial trial and error it seemed that this was the date format that LeagueGameFinder was expecting. This was all working fine earlier this past week.

@swar
Copy link
Owner

swar commented Nov 12, 2019

Could the issue be that there were no regular season games played 2019-10-06 and 2019-10-07?

I get results when I switch season_type_nullable to SeasonType().preseason instead.

@swar
Copy link
Owner

swar commented Nov 12, 2019

Also if this is still an issue, if you switch back to v1.1.4 does it still work?

@swar swar added the question Inquiry from community label Nov 13, 2019
@swar swar closed this as completed Jan 27, 2020
@swar
Copy link
Owner

swar commented Jan 27, 2020

Feel free to reopen if you're still having this issue.

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

No branches or pull requests

2 participants