James McCool
commited on
Commit
·
c12cb5f
1
Parent(s):
4a65adc
Add error handling for slate data loading in streamlit_app.py to ensure graceful degradation when fetching DraftKings and FanDuel slates. This improves robustness by preventing application crashes and providing default values when data is unavailable.
Browse files- src/streamlit_app.py +11 -2
src/streamlit_app.py
CHANGED
|
@@ -590,8 +590,17 @@ def convert_hb_df(array, column_names):
|
|
| 590 |
array = pd.DataFrame(array, columns=column_names)
|
| 591 |
return array.to_csv().encode('utf-8')
|
| 592 |
|
| 593 |
-
|
| 594 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 595 |
|
| 596 |
app_load_reset_column, app_view_site_column, = st.columns([1, 9])
|
| 597 |
with app_load_reset_column:
|
|
|
|
| 590 |
array = pd.DataFrame(array, columns=column_names)
|
| 591 |
return array.to_csv().encode('utf-8')
|
| 592 |
|
| 593 |
+
try:
|
| 594 |
+
slate_names_dk, slate_name_lookup_dk = define_dk_showdown_slates()
|
| 595 |
+
except:
|
| 596 |
+
slate_names_dk = []
|
| 597 |
+
slate_name_lookup_dk = {}
|
| 598 |
+
|
| 599 |
+
try:
|
| 600 |
+
slate_names_fd, slate_name_lookup_fd = define_fd_showdown_slates()
|
| 601 |
+
except:
|
| 602 |
+
slate_names_fd = []
|
| 603 |
+
slate_name_lookup_fd = {}
|
| 604 |
|
| 605 |
app_load_reset_column, app_view_site_column, = st.columns([1, 9])
|
| 606 |
with app_load_reset_column:
|