robertwb commented on a change in pull request #11901:
URL: https://github.com/apache/beam/pull/11901#discussion_r437749425
##########
File path: sdks/python/apache_beam/coders/row_coder.py
##########
@@ -82,8 +86,19 @@ def from_runner_api_parameter(schema, components,
unused_context):
return RowCoder(schema)
@staticmethod
- def from_type_hint(named_tuple_type, registry):
- return RowCoder(named_tuple_to_schema(named_tuple_type))
+ def from_type_hint(type_hint, registry):
+ if isinstance(type_hint, row_type.RowTypeConstraint):
+ schema = schema_pb2.Schema(
+ fields=[
+ schema_pb2.Field(
+ name=name,
+ type=typing_to_runner_api(type))
+ for (name, type) in type_hint._fields
+ ],
+ id=str(uuid.uuid4()))
Review comment:
Done.
----------------------------------------------------------------
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]