I have an app from a repo that I set up github actions to check for new data and push a commit each day. Here is an example commit. The first automatic update I had didn’t seem to work because streamlit didn’t check for file changes from non-imported files, so I added an import that gets updated with the latest to show the timestamp of the last data update in hopes that that would cause streamlit to recognize a dependent import changed. That seemed like it worked for one automatic commit from github actions, but now the latest commit linked above isn’t showing updates in the app.
Any suggestions on how to resolve this would be great. I’d like to get to the point where I can have new data automatically added to the repo (this part is done already with github actions) and the streamlit app automatically update to use the new data (broken part right now).
The Streamlit app will reload when the GitHub repo changes.
It looks like your GitHub Action did not commit any changes, either because there was no new data or there were no changes or because the Action is not working properly. I would take a look at the Github Action.
To confirm, I pulled the updates locally and ran the app which is using the new data. The current streamlit app is not using the data from that commit.
Edit: To be clear, the streamlit hosted app is not using the latest commit from actions-user 2 days ago. Pulling that commit locally and running shows the app using the data from that commit.
Ok I updated streamlit and started using the new st.cache_data, but that didn’t seem to resolve it either. What I found was that used imported “constants” from another module wouldn’t rerun when changes were made to the streamlit app. I think this may be a result of the way I use my own multi page class since it only runs one imported function of each app I wrote.
Once I updated my different page apps functions that get called to call the cached function directly, then it seemed to work as expected. I was able to see the TTL expire by printing out when the cache function ran after waiting longer than the TTL period.
Thanks for the suggestions which helped me diagnose what was going on. I expect it should fix future commits from github actions, but I will have to wait until the next one to confirm.
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.