TheNeuralBit commented on a change in pull request #11980:
URL: https://github.com/apache/beam/pull/11980#discussion_r471850250
##########
File path: sdks/python/apache_beam/typehints/schemas.py
##########
@@ -251,3 +258,23 @@ def named_tuple_from_schema(schema):
def named_tuple_to_schema(named_tuple):
return typing_to_runner_api(named_tuple).row_type.schema
+
+
+def schema_from_element_type(element_type): # (type) -> schema_pb2.Schema
+ """Get a schema for the given PCollection element_type.
+
+ Returns schema as a list of (name, python_type) tuples"""
+ if isinstance(element_type, row_type.RowTypeConstraint):
+ # TODO: Make sure beam.Row generated schemas are registered and de-duped
Review comment:
Filed BEAM-10722 for this
----------------------------------------------------------------
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]