James McCool
commited on
Commit
·
9887c91
1
Parent(s):
e533f8c
Refactor payout data handling in app.py
Browse files- Replaced conditional payout information retrieval with a try-except block to improve error handling during data processing.
- This change enhances the robustness of the data loading process by preventing potential crashes when payout information is unavailable.
app.py
CHANGED
|
@@ -405,11 +405,11 @@ if selected_tab == 'Data Load':
|
|
| 405 |
working_df['percentile_finish'] = working_df['index'].rank(pct=True)
|
| 406 |
working_df['finish'] = working_df['index']
|
| 407 |
working_df = working_df.drop(['sorted', 'index'], axis=1)
|
| 408 |
-
|
| 409 |
working_df['payout'] = working_df['finish'].apply(
|
| 410 |
lambda x: get_payout_for_position(x, st.session_state['payout_info'])
|
| 411 |
)
|
| 412 |
-
|
| 413 |
pass
|
| 414 |
|
| 415 |
elif st.session_state['type_init'] == 'Showdown':
|
|
@@ -486,11 +486,11 @@ if selected_tab == 'Data Load':
|
|
| 486 |
working_df['percentile_finish'] = working_df['index'].rank(pct=True)
|
| 487 |
working_df['finish'] = working_df['index']
|
| 488 |
working_df = working_df.drop(['sorted', 'index'], axis=1)
|
| 489 |
-
|
| 490 |
working_df['payout'] = working_df['finish'].apply(
|
| 491 |
lambda x: get_payout_for_position(x, st.session_state['payout_info'])
|
| 492 |
)
|
| 493 |
-
|
| 494 |
pass
|
| 495 |
|
| 496 |
# Store results
|
|
|
|
| 405 |
working_df['percentile_finish'] = working_df['index'].rank(pct=True)
|
| 406 |
working_df['finish'] = working_df['index']
|
| 407 |
working_df = working_df.drop(['sorted', 'index'], axis=1)
|
| 408 |
+
try:
|
| 409 |
working_df['payout'] = working_df['finish'].apply(
|
| 410 |
lambda x: get_payout_for_position(x, st.session_state['payout_info'])
|
| 411 |
)
|
| 412 |
+
except:
|
| 413 |
pass
|
| 414 |
|
| 415 |
elif st.session_state['type_init'] == 'Showdown':
|
|
|
|
| 486 |
working_df['percentile_finish'] = working_df['index'].rank(pct=True)
|
| 487 |
working_df['finish'] = working_df['index']
|
| 488 |
working_df = working_df.drop(['sorted', 'index'], axis=1)
|
| 489 |
+
try:
|
| 490 |
working_df['payout'] = working_df['finish'].apply(
|
| 491 |
lambda x: get_payout_for_position(x, st.session_state['payout_info'])
|
| 492 |
)
|
| 493 |
+
except:
|
| 494 |
pass
|
| 495 |
|
| 496 |
# Store results
|