You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/09/16 16:00:12 UTC

[jira] [Work logged] (BEAM-10906) Simple transform to make schema'd PCollections.

     [ https://issues.apache.org/jira/browse/BEAM-10906?focusedWorklogId=485216&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-485216 ]

ASF GitHub Bot logged work on BEAM-10906:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 16/Sep/20 16:00
            Start Date: 16/Sep/20 16:00
    Worklog Time Spent: 10m 
      Work Description: robertwb commented on a change in pull request #12832:
URL: https://github.com/apache/beam/pull/12832#discussion_r489550684



##########
File path: sdks/python/apache_beam/transforms/core.py
##########
@@ -2519,6 +2520,45 @@ def expand(self, pcoll):
             (*(key + value))))
 
 
+class ToRows(PTransform):
+  """Converts the elements of a PCollection into a schema'd PCollection of Rows.
+
+  `ToRow(...)` is roughly equivalent to `Map(lambda x: Row(...))` where each
+  argument (which may be a string or callable) of `ToRow` is applied to `x`.
+  For example,
+
+      pcoll | beam.ToRow('a', b=lambda x: foo(x))

Review comment:
       Good call. Done.

##########
File path: sdks/python/apache_beam/typehints/trivial_inference.py
##########
@@ -320,6 +325,10 @@ def infer_return_type(c, input_types, debug=False, depth=5):
             dict: typehints.Dict[Any, Any]
         }[c]
       return c
+    elif (c == getattr and len(input_types) == 2 and

Review comment:
       Done. All looks well.




----------------------------------------------------------------
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:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 485216)
    Remaining Estimate: 0h
            Time Spent: 10m

> Simple transform to make schema'd PCollections.
> -----------------------------------------------
>
>                 Key: BEAM-10906
>                 URL: https://issues.apache.org/jira/browse/BEAM-10906
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-py-core
>            Reporter: Robert Bradshaw
>            Assignee: Robert Bradshaw
>            Priority: P2
>          Time Spent: 10m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)