Streamlit cache breaks the code
See original GitHub issueThe code is hosted in GitHub and deployed to Streamlit sharing: https://github.com/aghasemi/plzcovid. I hope it makes an investigation easier
As you see in data.py
, I don’t use st.cache
, but the generic cachetools
package. The reason is, if I put Streamlit cache annotation on top of load_data
, I get KeyError: row
at line 39. Without the st.cache
(or using cachetools
), this error does not appear.
Many thanks Best
Edit: It’s not like 39 anymore, but three lines 45, 46, and 61.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Caching issues - Streamlit Docs
By default Streamlit expects its cached values to be treated as immutable -- that cached objects remain constant. You received this warning if...
Read more >caching with comprehension list with if · Issue #1801 - GitHub
Summary Caching a function with a comprehension list with an if inside seem ... Here's a sample code: import streamlit as st @st.cache()...
Read more >Streamlit script gets stuck on @st.cache - Stack Overflow
Everything works fine till I use @st.cache to cache the python object returned from above library. @st.cache() with no args gets stuck on...
Read more >How to use the streamlit.cache function in streamlit - Snyk
Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues...
Read more >Streamlit Tips, Tricks, and Hacks for Data Scientists - Medium
The main problem with caching the connection starts when two users run the code which caches the object at the same time. And...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes. They do seem related.
Looks like https://github.com/streamlit/streamlit/issues/1801 and https://github.com/streamlit/streamlit/issues/2305?