robertwb commented on a change in pull request #11963:
URL: https://github.com/apache/beam/pull/11963#discussion_r453137898
##########
File path: sdks/python/apache_beam/coders/row_coder.py
##########
@@ -87,7 +87,10 @@ def from_runner_api_parameter(schema, components,
unused_context):
@staticmethod
def from_type_hint(type_hint, registry):
if isinstance(type_hint, row_type.RowTypeConstraint):
- schema = named_fields_to_schema(type_hint._fields)
+ try:
+ schema = named_fields_to_schema(type_hint._fields)
+ except ValueError:
+ return typecoders.registry.get_coder(object)
Review comment:
Well, it's also there to handle the case where we simply don't know what
the type is. I'll see if I can re-work this to use named tuples (thanks for the
idea about `__reduce__`).
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]