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


##########
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:
   yes, i could do:
   ```
   (in _dynamic_function_reduce_)
   code_path = get_code_object_identifier(func) if 
self.config.enable_stable_code_identifier_pickling else None
   newargs = self._function_getnewargs(func)
   if code_path
     make_function = _make_function_from_identifier
     newargs = code_path
   else:
     make_function = _make_function
   return (make_function, newargs, {etc. etc.})
   ```
   



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