From 672aceb72d0ff69aa21926279b025f793cc571a0 Mon Sep 17 00:00:00 2001 From: Pratham Soni Date: Thu, 20 Jun 2024 09:31:49 -0500 Subject: [PATCH 1/2] table reload when doczy pipeline has fully run --- streamlit/interface_1.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/streamlit/interface_1.py b/streamlit/interface_1.py index 25666d5..861e195 100644 --- a/streamlit/interface_1.py +++ b/streamlit/interface_1.py @@ -265,7 +265,6 @@ with buttons[1]: st.error("Select at least one Group No. for every Contract") else: #Resets the Data Editor with Blank Values - update_dataframe() with st.spinner('Running...'): # csv_buf = StringIO() # additional_info.to_csv(csv_buf, header=True, index=False) @@ -282,6 +281,9 @@ with buttons[1]: response = requests.post(doczy_pipeline, json = myobj) if response.status_code >= 200 and response.status_code < 300: st.write("Success") + #Updates and Reruns the Code after everything on the interface has completed + update_dataframe() + st.experimental_rerun() # st.write(myobj) else: st.write("Failed") From 045737c186096e1069b5f36ffe3ccf187cda5d7f Mon Sep 17 00:00:00 2001 From: Pratham Soni Date: Thu, 20 Jun 2024 16:01:12 -0500 Subject: [PATCH 2/2] update dataframe on pipeline run --- streamlit/interface_1.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/streamlit/interface_1.py b/streamlit/interface_1.py index c788354..4bf6831 100644 --- a/streamlit/interface_1.py +++ b/streamlit/interface_1.py @@ -15,6 +15,11 @@ from constants import USER_LIST (REDIRECT_URI, create_batch_url, doczy_pipeline) = util.load_page_details(1) +def update_dataframe(): + new_df = pd.DataFrame(columns=['Contract Name', 'Unique Key','Pricing Before Carveouts' + , 'Contract Related', 'Provider', 'Timeline', 'Carveout Indicator', 'Carveout Methodology']) + st.session_state['dataframe'] = new_df + user_list = USER_LIST st.set_page_config(layout = "wide") # Sidebar contents @@ -272,7 +277,7 @@ with buttons[1]: st.write("Success") #Updates and Reruns the Code after everything on the interface has completed update_dataframe() - st.experimental_rerun() + st.rerun() # st.write(myobj) else: st.write("Failed")