Warn when calling st.foo from within st.cache#185
Merged
tvst merged 11 commits intostreamlit:developfrom Sep 27, 2019
Merged
Conversation
* develop: Release 0.46.0 (streamlit#170) Magic fixes (streamlit#138) [docs] Add analytics; redirect /secret/docs; fix compilation problem (streamlit#149) Fix bug for startup under windows (streamlit#144) Responsive layout (streamlit#104) Add basic PR template Better method signatures (streamlit#88) Publish docs to both /docs and /secret/docs, until we deprecate /secret/docs in January. (streamlit#141) Rename/report2app (streamlit#126)
# By Jonathan Rhone (3) and others # Via GitHub * develop: Text changes in ☰ menu and several CLI prompts (streamlit#180) add format option for slider widget and return texts for display values (streamlit#154) Merge ForwardMsg caching into develop (streamlit#178) e2e test for magic (streamlit#172) Bart example update (streamlit#179) Pedantic CircleCI cleanup (streamlit#174) Fix overwriting elements in the sidebar (streamlit#181) update vega lite chart snapshot (streamlit#183) Stop react-markdown from converting "[foo]" to a link. (streamlit#151) Issue 1204: Graphs using Vega-Lite (streamlit#56) Removing uber demo from streamlit repo (streamlit#159) # Conflicts: # lib/streamlit/DeltaGenerator.py
tvst
suggested changes
Sep 26, 2019
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a script calls a
st.foofrom within a cached function, show an st.warning telling the user that they probably don't want to do that.You can do
st.cache(supress_st_warning=True)to suppress the warning.This PR adds a thread local that contains some information about whether we're inside a cached function. There's some additional complexity around suppressing warnings in places where st calls can happen automatically (e.g.
st.cache's wrapper function can callst.spinner).Fixes #139