Pablo Estrada commented on BEAM-722:

I am working on adding this feature. I'm basically mirroring the way in which 
we do this in Java, but trying to make it a bit more Pythonic. Here's a quick 
example of how this would work:

class MyParDo(beam.PTransform):
  def display_data(self):
    return {'disp_data_key': MyParDo,
            'loneliest_number': 1,
            'secret_url': {'value': 'awebsite.com', 'url': 
'http://awebsite.com'} ,
            'fn': {'value': self.fn, 'label': 'Display data of underlying DoFn'}


I'm renaming the populateDisplayData function to display_data, and instead of 
using a builder, I return a dictionary of key:value pairs - and if a user wants 
to specify more parameters than just the key:value, they can pass a dictionary 
with them. Also, if the user passes as value an object that inherits from the 
HasDisplayData class, then that object's display data will be included.

I have a [small 
 that adds this. You can see some [examples in the few 

If everyone is okay with this, I'll add comments, tests, and address feedback.

> Add Display Data to the Python SDK
> ----------------------------------
>                 Key: BEAM-722
>                 URL: https://issues.apache.org/jira/browse/BEAM-722
>             Project: Beam
>          Issue Type: New Feature
>          Components: sdk-py
>            Reporter: Pablo Estrada
>            Assignee: Frances Perry
> The DisplayData feature has been added to the Java SDK (see blog post 
> announcing it: 
> https://cloud.google.com/blog/big-data/2016/06/dataflow-updates-see-more-details-about-your-pipelines).
>  We need now to add it to the Python SDK.

This message was sent by Atlassian JIRA

Reply via email to