James McCool commited on
Commit
7365d98
·
1 Parent(s): 764a992

Update grab_contest_player_info function in app.py to use contest_date instead of contest_name

Browse files

- Modified the grab_contest_player_info function to accept contest_date as a parameter, improving the accuracy of player information retrieval.
- Adjusted the DataFrame filtering to utilize contest_date, ensuring correct data mapping for player details.
- Maintained existing functionality while enhancing the clarity and correctness of player data handling during contest processing.

Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -32,7 +32,7 @@ def grab_contest_names(db, sport, type):
32
 
33
  return contest_names, contest_id_map, curr_info
34
 
35
- def grab_contest_player_info(db, sport, type, contest_name, contest_id_map):
36
  if type == 'Classic':
37
  db_type = 'reg'
38
  elif type == 'Showdown':
@@ -41,7 +41,7 @@ def grab_contest_player_info(db, sport, type, contest_name, contest_id_map):
41
  cursor = collection.find()
42
 
43
  player_info = pd.DataFrame(list(cursor)).drop('_id', axis=1)
44
- player_info = player_info[player_info['Contest ID'] == contest_id_map[contest_name]]
45
  player_info = player_info.rename(columns={'Display Name': 'Player'})
46
 
47
  info_maps = {
 
32
 
33
  return contest_names, contest_id_map, curr_info
34
 
35
+ def grab_contest_player_info(db, sport, type, contest_date):
36
  if type == 'Classic':
37
  db_type = 'reg'
38
  elif type == 'Showdown':
 
41
  cursor = collection.find()
42
 
43
  player_info = pd.DataFrame(list(cursor)).drop('_id', axis=1)
44
+ player_info = player_info[player_info['Contest Date'] == contest_date]
45
  player_info = player_info.rename(columns={'Display Name': 'Player'})
46
 
47
  info_maps = {