From 57640fd3423ea7dece100c354fa98678f99ce71d Mon Sep 17 00:00:00 2001 From: Romain Date: Sat, 23 Mar 2024 13:07:31 -0700 Subject: [PATCH] Fix an issue when unpickling functions through the escape hatch (#1770) --- metaflow/plugins/env_escape/client.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/metaflow/plugins/env_escape/client.py b/metaflow/plugins/env_escape/client.py index cb004fdf2f8..715e7c4f750 100644 --- a/metaflow/plugins/env_escape/client.py +++ b/metaflow/plugins/env_escape/client.py @@ -386,7 +386,13 @@ def name_to_parent_name(name): raise RuntimeError("Local function unpickling without an object ID") if obj_id not in self._proxied_standalone_functions: self._proxied_standalone_functions[obj_id] = create_class( - self, "__function_%s" % obj_id, {}, {}, {}, {"__call__": ""}, [] + self, + "__main__.__function_%s" % obj_id, + {}, + {}, + {}, + {"__call__": ""}, + [], ) return self._proxied_standalone_functions[obj_id] local_class = self._proxied_classes.get(lookup_name, None)