James McCool commited on
Commit
d92006d
·
1 Parent(s): 17befda

Refactor date list generation in app.py for improved efficiency

Browse files

- Simplified the logic for generating the date list by combining the extraction of unique dates and sorting into a single line, enhancing code readability and performance.
- Ensured that the date selection dropdown continues to function correctly, maintaining the user experience for contest selection.

Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -58,8 +58,7 @@ with tab1:
58
  contest_names, contest_id_map, curr_info = grab_contest_names(db, sport_select)
59
 
60
  with col3:
61
- date_list_raw = curr_info['Date'].unique()
62
- date_list = date_list_raw.sort_values(ascending=False)
63
  date_select = st.selectbox("Select Date", date_list, key='date_select')
64
 
65
  name_parse = curr_info[curr_info['Date'] == date_select]['Contest Name'].reset_index(drop=True)
 
58
  contest_names, contest_id_map, curr_info = grab_contest_names(db, sport_select)
59
 
60
  with col3:
61
+ date_list = curr_info['Date'].sort_values(ascending=False).unique()
 
62
  date_select = st.selectbox("Select Date", date_list, key='date_select')
63
 
64
  name_parse = curr_info[curr_info['Date'] == date_select]['Contest Name'].reset_index(drop=True)