James McCool commited on
Commit
c7547fd
·
1 Parent(s): 8bf3222

Refactor payout type handling in app.py

Browse files

- Changed the database type identifier for 'Showdown' from 'showdown' to 'sd' to streamline data retrieval.
- Removed unnecessary type casting for 'Contest ID' and 'value' columns, simplifying the data processing logic.

Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -61,14 +61,12 @@ def grab_contest_payout_info(db, sport, type, contest_date, contest_name, contes
61
  if type == 'Classic':
62
  db_type = 'reg'
63
  elif type == 'Showdown':
64
- db_type = 'showdown'
65
  collection = db[f'{sport}_{db_type}_payout_info']
66
  cursor = collection.find()
67
 
68
  payout_info = pd.DataFrame(list(cursor)).drop('_id', axis=1)
69
  payout_info = payout_info[payout_info['Contest Date'] == contest_date]
70
- payout_info['Contest ID'] = payout_info['Contest ID'].astype(int)
71
- payout_info['value'] = payout_info['value'].astype(int)
72
 
73
  return payout_info
74
 
 
61
  if type == 'Classic':
62
  db_type = 'reg'
63
  elif type == 'Showdown':
64
+ db_type = 'sd'
65
  collection = db[f'{sport}_{db_type}_payout_info']
66
  cursor = collection.find()
67
 
68
  payout_info = pd.DataFrame(list(cursor)).drop('_id', axis=1)
69
  payout_info = payout_info[payout_info['Contest Date'] == contest_date]
 
 
70
 
71
  return payout_info
72