How to avoid running a function that reads Google Sheets every time a filter component is selected/clicked?

I have a script that reads Google Sheets and creates a Pandas data frame, then this data frame is used to create charts, I included a section to filter the data frame.
Every time that a filter is chosen the function to read the Google Sheets is running again. I used st.cache, but it seems it is not working.
I am getting the APIError 429 "Quota exceeded for quota metric ‘Read requests’ and limit ‘Read requests per minute per user’ of service ‘sheets.googleapis.com

How can I avoid this error?

I do not want to run the function that reads the google sheet running all the time, just once, when the user open the application.

This sounds like a great use case for caching! Check out the docs and let us know if you have any questions.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.