Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: mo.cache args for docs (#4818)

Dylan Madisettib40e8904fa6f
diff --git a/marimo/_save/save.py b/marimo/_save/save.py
index ebc6ae66ca..b143d49315 100644
--- a/marimo/_save/save.py
+++ b/marimo/_save/save.py
@@ -494,6 +494,7 @@ def cache(
def cache( # type: ignore[misc]
name: Union[str, Optional[Callable[..., Any]]] = None,
*args: Any,
+ pin_modules: bool = False,
loader: Optional[Union[LoaderPartial, Loader]] = None,
_frame_offset: int = 1,
_internal_interface_not_for_external_use: None = None,
@@ -578,6 +579,7 @@ def cache( # type: ignore[misc]
loader,
*args,
frame_offset=_frame_offset + 1,
+ pin_modules=pin_modules,
**kwargs,
)
@@ -684,6 +686,7 @@ def persistent_cache( # type: ignore[misc]
method: LoaderKey = "pickle",
store: Optional[Store] = None,
*args: Any,
+ pin_modules: bool = False,
_internal_interface_not_for_external_use: None = None,
**kwargs: Any,
) -> Union[_cache_call, _cache_context]:
@@ -807,6 +810,7 @@ def persistent_cache( # type: ignore[misc]
*args,
loader=loader,
_frame_offset=2,
+ pin_modules=pin_modules,
**kwargs,
),
)