James McCool commited on
Commit
34bba3a
·
1 Parent(s): 331bab1

Add error handling for position replacement in CSV loading process for Fanduel site. This ensures that any exceptions during the replacement of 'D' with 'DST' are gracefully handled without interrupting the flow.

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -282,7 +282,10 @@ if selected_tab == 'Data Load':
282
  st.session_state['csv_file']['Position'] = 'FLEX'
283
  st.session_state['csv_file']['Team'] = 'NASCAR'
284
  if site_var == 'Fanduel':
285
- st.session_state['csv_file']['Position'] = st.session_state['csv_file']['Position'].replace('D', 'DST', regex=False)
 
 
 
286
  st.success('Projections file loaded successfully!')
287
  st.dataframe(st.session_state['csv_file'].head(10))
288
 
 
282
  st.session_state['csv_file']['Position'] = 'FLEX'
283
  st.session_state['csv_file']['Team'] = 'NASCAR'
284
  if site_var == 'Fanduel':
285
+ try:
286
+ st.session_state['csv_file']['Position'] = st.session_state['csv_file']['Position'].replace('D', 'DST', regex=False)
287
+ except:
288
+ pass
289
  st.success('Projections file loaded successfully!')
290
  st.dataframe(st.session_state['csv_file'].head(10))
291