James McCool
commited on
Commit
·
c4992bf
1
Parent(s):
d884d9a
Enhance column exclusion handling in 'Manage Portfolio' by adding error handling for multiselect options, ensuring robustness when columns are missing.
Browse files
app.py
CHANGED
@@ -2022,7 +2022,10 @@ if selected_tab == 'Manage Portfolio':
|
|
2022 |
with combo_size_col:
|
2023 |
combo_size = st.selectbox("Combo Size", [2, 3], key='combo_size')
|
2024 |
with columns_excluded_col:
|
2025 |
-
|
|
|
|
|
|
|
2026 |
with combo_analyze_col:
|
2027 |
submitted = st.form_submit_button("Analyze Combos")
|
2028 |
if submitted:
|
|
|
2022 |
with combo_size_col:
|
2023 |
combo_size = st.selectbox("Combo Size", [2, 3], key='combo_size')
|
2024 |
with columns_excluded_col:
|
2025 |
+
try:
|
2026 |
+
excluded_cols_extended = st.multiselect("Exclude Columns?", st.session_state['display_frame'].drop(columns=excluded_cols).columns, key='excluded_cols_extended')
|
2027 |
+
except:
|
2028 |
+
excluded_cols_extended = st.multiselect("Exclude Columns?", st.session_state['display_frame'].columns, key='excluded_cols_extended')
|
2029 |
with combo_analyze_col:
|
2030 |
submitted = st.form_submit_button("Analyze Combos")
|
2031 |
if submitted:
|