chamikaramj commented on code in PR #23739:
URL: https://github.com/apache/beam/pull/23739#discussion_r999944455


##########
sdks/python/apache_beam/typehints/schemas.py:
##########
@@ -463,19 +463,20 @@ def named_tuple_from_schema(self, schema: 
schema_pb2.Schema) -> type:
 
     # Define a reduce function, otherwise these types can't be pickled
     # (See BEAM-9574)
-    def __reduce__(self):
-      return (
-          _hydrate_namedtuple_instance,
-          (schema.SerializeToString(), tuple(self)))
-
-    setattr(user_type, '__reduce__', __reduce__)
+    setattr(user_type, '__reduce__', _named_tuple_reduce)

Review Comment:
   To clarify, Cloud Pickle only looks for a `__reduce__` method and setting 
the `__reduce__` attribute does not trigger proto pickling ?



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