robertwb commented on a change in pull request #14470:
URL: https://github.com/apache/beam/pull/14470#discussion_r609961672
##########
File path: sdks/python/apache_beam/pipeline.py
##########
@@ -1248,7 +1249,18 @@ def transform_to_runner_api(
environment_id=environment_id,
annotations=self.annotations,
# TODO(BEAM-366): Add display_data.
- display_data=None)
+ display_data=[
+ beam_runner_api_pb2.DisplayData(
+
urn=common_urns.StandardDisplayData.DisplayData.LABELLED_STRING.
Review comment:
I'm curious what the value of this URN is if it's always constant.
##########
File path: sdks/python/apache_beam/pipeline.py
##########
@@ -1248,7 +1249,18 @@ def transform_to_runner_api(
environment_id=environment_id,
annotations=self.annotations,
# TODO(BEAM-366): Add display_data.
- display_data=None)
+ display_data=[
+ beam_runner_api_pb2.DisplayData(
+
urn=common_urns.StandardDisplayData.DisplayData.LABELLED_STRING.
+ urn,
+ payload=beam_runner_api_pb2.LabelledStringPayload(
+ label=dd.get_dict()['label']
+ if 'label' in dd.get_dict() else None,
+ value=str(
+ dd.get_dict()['value'] if 'value' in
+ dd.get_dict() else None)).SerializeToString())
+ for dd in DisplayData.create_from(self.transform).items if dd.label
Review comment:
Let's add a to_proto method on DisplayData rather than always
stringifying the value and using dd.get_dict() everywhere here.
--
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]