Select needed columns from file1 and file2 and pass them as variables
Does a bunch of operations
Click a button to sequentially do a few different operations
Click a button to generate export links
The problem that I currently have is that the app reset itself (need to re-enter file 1 and file 2) after item 3 or item 4 or item 5. It seems to be loading, calculating for a while and then it resets the page and I have to start the process all over again. Why is that and how can I fix it?
Thank you
I have a very similar issue where my data-cleaning app resets almost at random while people are working through pages. Any luck finding a solutions on this?
My application is a dashboard for a sales report. I use the file uploader to upload an Excel sheet, which then provides me with sidebar filters and charts. The issue is that the app will reset (similar to refreshing the website) and I will have to start over. It’s troublesome since I have so much data filtered that I have to redo it again.
I read somewhere here that many are facing the same issue, i use streamlit share for my app. not sure if there is a fix to it.
Hi @Ummair_Radi, this might be a true bug that needs to be reported, or there might be a different way of building your app that will avoid this. But, in order to be able to figure that out, we need to have a reproducible example that demonstrates this issue. See this post for more details.
you can check my code here if you like but that data is confidential because it’s a sales report, it has more than 40k rows in the excel file. if you see anything that could be changed or modified let me know. i tried using cache ttl but i am not sure what it really does but i saw some improvements. it will stay longer then the page will refresh/reset.
I tried using your code with an example excel file that I made, and couldn’t reproduce the issue. Can you please share some dummy data that I can use for the app, and explain the steps that reproduce the error?
Could you try using st.experimental_memo instead of st.cache? That’s the recommended way to cache data, rather than the deprecated st.cache.
When we interact on the widgets, etc., and possibly disconnects on the uploaded file [1], we always have the df in session variable.
Don’t do this:
if uploaded_file:
# run stuff
Do like this:
if uploaded_file:
# save df to session state variable
st.session_state.df1 = df1
# Start main and others and use st.session_state.df1
# ---- SIDEBAR ----
...
# ---- MAINPAGE ----
...
If uploaded file is lost, it does not matter anymore, we already have the df in session variable.
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.