James McCool
commited on
Commit
·
f0e4b10
1
Parent(s):
ab4dc7d
Improve export handling in app.py: add a conditional check to initialize the export_merge session state variable only if it doesn't already exist, ensuring data integrity during portfolio export operations.
Browse files
app.py
CHANGED
|
@@ -1022,7 +1022,8 @@ with tab2:
|
|
| 1022 |
)
|
| 1023 |
st.session_state['portfolio'] = st.session_state['portfolio'][lock_mask]
|
| 1024 |
st.session_state['portfolio'] = st.session_state['portfolio'].sort_values(by='median', ascending=False)
|
| 1025 |
-
|
|
|
|
| 1026 |
with st.expander("Download options"):
|
| 1027 |
if stack_dict is not None:
|
| 1028 |
download_type = st.selectbox("Simple or Advanced Download?", options=['Simple', 'Advanced'], key='download_choice')
|
|
|
|
| 1022 |
)
|
| 1023 |
st.session_state['portfolio'] = st.session_state['portfolio'][lock_mask]
|
| 1024 |
st.session_state['portfolio'] = st.session_state['portfolio'].sort_values(by='median', ascending=False)
|
| 1025 |
+
if 'export_merge' not in st.session_state:
|
| 1026 |
+
st.session_state['export_merge'] = st.session_state['portfolio'].copy()
|
| 1027 |
with st.expander("Download options"):
|
| 1028 |
if stack_dict is not None:
|
| 1029 |
download_type = st.selectbox("Simple or Advanced Download?", options=['Simple', 'Advanced'], key='download_choice')
|