The following lines in config.toml
[client]
showErrorDetails = "none"
are correctly hiding the trace stack but not the warning
CachedWidgetWarning: Your script uses a widget command in a cached function (function decorated with @st.cache_data or @st.cache_resource). This code will only be called when we detect a cache "miss", which can lead to unexpected results.
and showing the trace stack after it, which could lead to data leaks. Is it a bug or am I doing something wrong?
The setting only applies to “deprecation warnings” and “errors,” so other warnings still come through, as far as I understand.
Here’s a feature request you can upvote: Include all warnings (not just deprecation warnings) in `client.showErrorDetaila` · Issue #12101 · streamlit/streamlit · GitHub
Thank you. Is there a temporary fix I can apply in the while? I absolutely need to show widgets inside cached functions and I cannot deploy the app with the stack trace.
I tried using experimental_allow_widget
, but it shows the following deprecation warning
The cached widget replay feature was removed in 1.38. The experimental_allow_widgets parameter will also be removed in a future release. Please remove the experimental_allow_widgets parameter from the @st.cache_data decorator and move all widget commands outside of cached functions.
To speed up your app, we recommend moving your widgets into fragments. Find out more about fragments in our docs.
If you have a specific use-case that requires the experimental_allow_widgets functionality, please tell us via an issue on Github.
No matter what the showErrorDetails
is set to. Is this a bug?
I don’t know of a way to suppress that warning, but can you explain your use case for needing a widget in the cached function? Perhaps I can suggest a different solution.