claudevdm commented on code in PR #35904:
URL: https://github.com/apache/beam/pull/35904#discussion_r2417746957


##########
sdks/python/apache_beam/internal/cloudpickle/cloudpickle.py:
##########
@@ -1305,6 +1325,30 @@ class Pickler(pickle.Pickler):
 
   dispatch_table = ChainMap(_dispatch_table, copyreg.dispatch_table)
 
+  def _stable_identifier_function_reduce(self, func):
+    code_object_params = self.config.get_code_object_params
+    if code_object_params is None:
+      return self._dynamic_function_reduce(func)
+    code_path = code_object_params.get_code_object_identifier(func)
+    if not code_path:
+      return self._dynamic_function_reduce(func)
+    newargs = (
+        code_path,
+        func.__globals__,

Review Comment:
   I think this is the issue the entire func.__globals__ is being pickled. We 
should filter the globals down like in 
https://github.com/apache/beam/blob/ac4b5ab2aac87f1e1d71fc97637514b9b9292ef5/sdks/python/apache_beam/internal/cloudpickle/cloudpickle.py#L1347



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to