Hello,
I would like to know if there is a problem with “@st.cache_data”, these 2 last days, I’ve noticed that functions with “@st.cache_data” decorator are no longer cached correctly and rerun as if the cache was at 0(ttl=0s).
For other information :
I have noticed this behavior on the apps deployed on the streamlit community cloud, and when i run the app locally, i got this eror message :
streamlit\util.py:227: RuntimeWarning:
coroutine 'expire_cache' was never awaited
I haven’t changed my code for a while, and here is how i decoracte the functions :
hello thank you for your reply, i cannot share this app because it’s a private one for teamwork, but here is a eror message i have on the Manage app logs :
/home/adminuser/venv/lib/python3.9/site-packages/streamlit/util.py:227: RuntimeWarning: coroutine 'expire_cache' was never awaited
pass
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
This app is continuously loading and reloading the main function. I have only a side bar with a spinner that keeps running without stopping, displaying messages like: 'Running get_function... '"
for the time being go and use cachetools.func.ttl_cache as workaround.
functionality for user should be alsmost the same, except that progress animation will be not showing.
and yes, after updating to 1.32 iam facing same issue.
streamlit/util.py:227: RuntimeWarning: coroutine ‘expire_cache’ was never awaited
pass
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
But im seeing this warning after integrating asyncio and im using @st.cache_data decorator. it might be due to an incompatibility or incorrect usage of asynchronous functions with Streamlit’s cache.
But it doesn’t directly affect the functionality of my app. Just slowing initial loading.
Same problem here. Didn’t occur before I updated from 1.31.1 to 1.32.0. Doesn’t happen now after I reverted back to 1.31.1. I don’t need anything from 1.32.0 so I’ll just stick to 1.31.1 for now.
We have an issue with the 1.32.0 version which causes the mentioned RuntimeWarning and our CPU utilization to max out The 1.32.1 patch will likely fix that, but it needs a bit further evaluation.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.