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


##########
sdks/python/apache_beam/internal/cloudpickle/cloudpickle.py:
##########
@@ -1266,7 +1274,11 @@ def _dynamic_function_reduce(self, func):
     """Reduce a function that is not pickleable via attribute lookup."""
     newargs = self._function_getnewargs(func)
     state = _function_getstate(func)
-    return (_make_function, newargs, state, None, None, _function_setstate)
+    if type(newargs[0]) == str:

Review Comment:
   > the first element that function_getnewargs returns is a string if the code 
object identifier was able to be created. in that case, we want to use 
make_function_from_identifier.
    
   Instead of modifying   _function_getnewargs could we instead have the 
branching within _dynamic_function_reduce? It looks like _function_getnewargs 
is not used anywhere else.



-- 
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