I’m finding that the disableWidgetStateDuplicationWarning flag in the config.toml is having no effect when running in a bazel environment, even after a bunch of hacking (not sure if required) of bazel scripts so that the working directory as seen from the streamlit app is the project dir rather than the bazel repo base dir.
minimal_example.py:
import streamlit as st
st.session_state["widget_key"] = st.session_state.get("widget_key", 3)
input_value = st.number_input(
"Input Value", value=4, min_value=1, max_value=5, step=1, key="widget_key")
import os
st.text(os.getcwd())
st.text(os.listdir(os.getcwd()))
./streamlit/config.toml:
[global]
disableWidgetStateDuplicationWarning = true
[logger]
level = "debug"
[theme]
backgroundColor = "black"
base = "dark"
I want this warning suppressed so that I can manually preserve widget state across page changes by writing to session_state, and also write a value when creating the widget. Why don’t I just write the value to a widget using session_state after creating it? Besides the annoyance, because that’s not working in the case of an imported wrapper function that creates a widget - the widget just gets initialized to its min value.
