chamikaramj commented on code in PR #23739:
URL: https://github.com/apache/beam/pull/23739#discussion_r999979089
##########
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)
self.schema_registry.add(user_type, schema)
coders.registry.register_coder(user_type, coders.RowCoder)
return user_type
+def _named_tuple_reduce(self):
Review Comment:
This method seems incorrect. Did you mean to use "schema" as a parameter
here instead of "self" ?
--
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]