fix: hash on unspecified keyword values#8127
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
mscolnick
previously approved these changes
Feb 5, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes issue #7977 where mo.cache was not invalidating when default argument values changed, leading to stale cached results. The fix ensures that default argument values are included in the cache hash computation.
Changes:
- Modified
_cache_callclass to track default argument values and keyword-only arguments - Updated cache hashing logic to include default values when arguments are not explicitly provided
- Added comprehensive tests covering various function signature forms and edge cases
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
marimo/_save/save.py |
Added tracking of default argument values and keyword-only parameters; modified _prepare_call_execution to inject defaults into the hash scope |
tests/_save/test_hash.py |
Added three new test methods covering default argument cache invalidation, explicit arguments matching previous defaults, and various function signature forms |
tests/_save/test_cache.py |
Updated test_shadowed_kwargs to reflect the corrected behavior where explicit arguments matching defaults result in cache hits |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mscolnick
approved these changes
Feb 5, 2026
|
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.19.8-dev33 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Summary
closes #7977
Fixes issue in calculating
mo.cachevalues. Although we tracked kwargs passed in, we didn't track the default kwargs. This PR injects default kwargs into hashed scope.