beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pablo Estrada (JIRA)" <>
Subject [jira] [Commented] (BEAM-722) Add Display Data to the Python SDK
Date Fri, 14 Oct 2016 19:59:20 GMT


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

class MyParDo(beam.PTransform):
  def display_data(self):
    return {'disp_data_key': MyParDo,
            'loneliest_number': 1,
            'secret_url': {'value': '', 'url': ''} ,
            '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 commit|]
that adds this. You can see some [examples in the few unittests|].

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:
>             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:
We need now to add it to the Python SDK.

This message was sent by Atlassian JIRA

View raw message