From 7a5e82bf79539f103373af3591b4e68c2999bec2 Mon Sep 17 00:00:00 2001 From: Luciano Silva do Lago Date: Sun, 21 Jun 2026 18:19:26 -0300 Subject: [PATCH] Fix: Streamlit deprecation warning use_container_width -> width='stretch' --- app/dashboard.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/dashboard.py b/app/dashboard.py index 77eb97b..c0fe436 100644 --- a/app/dashboard.py +++ b/app/dashboard.py @@ -126,7 +126,7 @@ with tab1: with col_title: st.header("Passenger Demands") with col_reset: - if st.button("🔄 Reset DB to Raw CSV", type="secondary", use_container_width=True): + if st.button("🔄 Reset DB to Raw CSV", type="secondary", width="stretch"): init_db(demands_raw, df_fleet, force_reset=True) st.success("Database Reset!") st.rerun() @@ -137,12 +137,12 @@ with tab1: edited_demand = st.data_editor( df_display_demand, num_rows="dynamic", - use_container_width=True, + width="stretch", hide_index=True, key="demand_editor" ) - if st.button("💾 Save Demand Changes", type="primary", use_container_width=True): + if st.button("💾 Save Demand Changes", type="primary", width="stretch"): with sqlite3.connect(DB_PATH) as conn: conn.execute("DROP TABLE IF EXISTS demandas") conn.execute(''' @@ -177,12 +177,12 @@ with tab2: st.info("💡 Edit specs directly below to simulate larger fleets, different fuel burn, or cargo capacity.") edited_fleet = st.data_editor( df_display_fleet, - use_container_width=True, + width="stretch", hide_index=True, key="fleet_editor" ) - if st.button("💾 Save Fleet Changes", type="primary", use_container_width=True): + if st.button("💾 Save Fleet Changes", type="primary", width="stretch"): rename_back = { 'Modelo': 'Modelo', 'Squadron': 'Emissor', 'Fleet Size': 'Tamanho da Frota', 'Fuel Usage (km/l)': 'Consumo (km/l)', 'Mean Speed (km/h)': 'Velocidade Média (km/h)', @@ -259,7 +259,7 @@ with tab4: col_prev, col_drop, col_next = st.columns([1, 8, 1]) with col_prev: st.markdown("
", unsafe_allow_html=True) - if st.button("⬅️", disabled=current_idx==0, use_container_width=True): + if st.button("⬅️", disabled=current_idx==0, width="stretch"): st.session_state.current_map_date = dias_disponiveis[current_idx - 1] st.rerun() with col_drop: @@ -269,7 +269,7 @@ with tab4: st.rerun() with col_next: st.markdown("
", unsafe_allow_html=True) - if st.button("➡️", disabled=current_idx>=len(dias_disponiveis)-1, use_container_width=True): + if st.button("➡️", disabled=current_idx>=len(dias_disponiveis)-1, width="stretch"): st.session_state.current_map_date = dias_disponiveis[current_idx + 1] st.rerun() @@ -342,7 +342,7 @@ with tab4: }, inplace=True) st.subheader(f"Flight Schedule for {st.session_state.current_map_date}") - st.dataframe(df_day_display, use_container_width=True) + st.dataframe(df_day_display, width="stretch") # --- TAB 5: RESULTS --- with tab5: @@ -372,7 +372,7 @@ with tab5: pass if not df_results.empty: - st.dataframe(df_results, use_container_width=True) + st.dataframe(df_results, width="stretch") if 'Pernoites' in df_results.columns: st.subheader("Days Out of Base (Pernoites) Breakdown")