diff --git a/modin/utils.py b/modin/utils.py index 2a7df885172..34071be132b 100644 --- a/modin/utils.py +++ b/modin/utils.py @@ -944,3 +944,17 @@ def __init__(self, func: Any): def __get__(self, instance: Any, owner: Any) -> Any: # noqa: GL08 return self.fget(owner) + + +def reload_modin() -> None: + """ + Reload all previously imported Modin modules. + + The call to this function is required + if an execution engine has been shut down and + is going to be started up once again. + """ + modules = sys.modules.copy() + for name, module in modules.items(): + if name.startswith("modin"): + importlib.reload(module)