Skip to content

Add display_data to AppliedPTransforms#35380

Merged
damccorm merged 4 commits intoapache:masterfrom
hjtran:appliedtransform_displaydata
Jun 26, 2025
Merged

Add display_data to AppliedPTransforms#35380
damccorm merged 4 commits intoapache:masterfrom
hjtran:appliedtransform_displaydata

Conversation

@hjtran
Copy link
Copy Markdown
Contributor

@hjtran hjtran commented Jun 20, 2025

This adds a display_data attribute to AppliedPTransforms, similar to annotations and resource_hints. This gives us a little more flexibility with adding display data, e.g. if someone wants to create a PipelineVisitor that adds general display data for every ptransform (like a link to github pointing to the source)


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@hjtran hjtran changed the title define display_data as a appliedptransform attribute similar to annot… Add display_data to AppliedPTransforms Jun 26, 2025
@hjtran hjtran marked this pull request as ready for review June 26, 2025 13:46
@github-actions
Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @damccorm for label python.

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

Copy link
Copy Markdown
Contributor

@damccorm damccorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - this generally lgtm, just had one question

self._perform_exernal_transform_test(transform_node.transform)


class DisplayDataContainer(HasDisplayData):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this class actually used?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sorry, leftover from a prior implementation that I scrapped. I originally grabbed all display data from the transform at AppliedPTransform instantiation time, but turns out some transforms define their display_data at transform expansion time (which is after AppliedPTransform instantiation time).

Will remove this

Copy link
Copy Markdown
Contributor

@damccorm damccorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I'll let checks complete before merging

@damccorm damccorm merged commit 048405d into apache:master Jun 26, 2025
87 checks passed
shunping pushed a commit to shunping/beam that referenced this pull request Jun 27, 2025
* define display_data as a appliedptransform attribute similar to annotatoins

* Adjust for transforms that define their display data at expand time

* extend base case unit test

* remove unused diplaydatacontainer class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants