Fix #36 cosmetic MemoryCache warning at CLI startup#38
Open
NetZissou wants to merge 1 commit into
Open
Conversation
Streamlit 1.58 emits "No runtime found, using MemoryCacheStorageManager" when `@st.cache_data` is decorated (at import) without a runtime. The CLI lancher imports the app module to reach `main()` before the server runtime exists, so importing any cache-decorated component warns. The @st.cache_data is a Streamlit decorator, it eagerly initializes a cache-storage manager, which is looking for a runtime. Breakdown sequence: ``` entry point reach main -> importing the app modules -> top-level imports pull in those cache-decorated component modules -> decoration ran in the bare launcher process (no runtime) -> warning ``` The fix move component imports into `app()` in both applications so the launcher process never touches `@st.cache_data` decorator. The real server runs `app()` under a live Streamlit runtime.
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.
Streamlit 1.58 emits "No runtime found, using MemoryCacheStorageManager" when
@st.cache_datais decorated (at import) without a runtime. The CLI lancher imports the app module to reachmain()before the server runtime exists, so importing any cache-decorated component warns.The @st.cache_data is a Streamlit decorator, it eagerly initializes a cache-storage manager, which is looking for a runtime.
Breakdown sequence:
The fix move component imports into
app()in both applications so the launcher process never touches@st.cache_datadecorator. The real server runsapp()under a live Streamlit runtime.