-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: handle shadowed variables in mo.cache, update tutorials #2480
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Is this on the cache hit? |
marimo/_save/save.py
Outdated
# In case scope shadoes variables | ||
for arg in self._args: | ||
self.scope.pop(arg, None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah this is what I was looking for
… error is probably best (at least a warning maybe?)
import functools | ||
|
||
|
||
@functools.cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can check with _plots.cache_info().hits
, and as was, there would never be a cache hit with functools, since the function would get redefined and clear the cache
I did find that for, mo.cache, private functions did not have a persistent cache- but solved that
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.8.23-dev26 |
This PR updates tutorials to use
mo.cache
, and fixesmo.cache
to handle shadowed variables.