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]: Data Not Reconciling #470

Open
bbq-x opened this issue Oct 20, 2024 · 3 comments
Open

[Bug]: Data Not Reconciling #470

bbq-x opened this issue Oct 20, 2024 · 3 comments
Labels
endpoint: third-party issue Issues, unrelated to the library, that exists within the 3rd-party's API service.

Comments

@bbq-x
Copy link

bbq-x commented Oct 20, 2024

NBA API Version

1.6.0

Issue

The last game of the finals (game_id: 0042300404), the aggregated data for the teams is not equal between 'playergamelogs' and 'teamdashlineups' endpoints. I have been able to collect data from both endpoints by game id and period for literally every game the previous three seasons except for the game listed above.

Code

This is the code I use to validate the two sources. I use the API to store to a database and then I pull from my database
def get_stats(table,table_var,id):
sql = f"select {test_json} from {table}_{table_var} where game_id = '{id}'"
df = pd.read_sql_query(sql,con=engine)
df.columns = common_cols

return df

sql = f"select game_id from events_{table_var}"
with con.cursor() as cur:
cur.execute(sql)
games = [item[0] for item in cur.fetchall()] # Returns table data in a one-element tuple

for id in games:
comp_list = []
for table in table_names[1:]:
comp_list.append(get_stats(table,table_var,id))
for col in common_cols:
player_val = comp_list[0][col].iloc[0]
lineup_val = comp_list[1][col].iloc[0]
if player_val != lineup_val:
if col != "TOV":
print(id,col,player_val,lineup_val)

@bbq-x bbq-x added bug Something isn't working triage Researching into a possible bug labels Oct 20, 2024
@rsforbes rsforbes added endpoint: third-party issue Issues, unrelated to the library, that exists within the 3rd-party's API service. and removed bug Something isn't working triage Researching into a possible bug labels Oct 23, 2024
@rsforbes
Copy link
Collaborator

@bbq-x - The NBA manages all data, we are just passing that data through the library. You could attempt to contact the NBA, but I'm uncertain of that process.

@bbq-x
Copy link
Author

bbq-x commented Oct 23, 2024 via email

@rsforbes rsforbes reopened this Oct 31, 2024
@bbq-x
Copy link
Author

bbq-x commented Nov 3, 2024

validation.docx

Attached is a document that better explains my issue. I use playergamelogs and iterate by period. I compare this data to the period data obtained using teamdashlineups.

I have acquired data from these two endpoints for the entire three previous seasons. The document lays out the discrepancies. The parsing of the info is as follows:
[game_id] [team_id] [column] [period] [comparison status] [discrepancy]

For turnovers, they're a mess. [total from playergamelogs] : [total from teamdashlineups]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
endpoint: third-party issue Issues, unrelated to the library, that exists within the 3rd-party's API service.
Projects
None yet
Development

No branches or pull requests

2 participants