question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Streamlit cache breaks the code

See original GitHub issue

The 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:open
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
aghasemicommented, Nov 17, 2020

Yes. They do seem related.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found