Skip to content

Added documentation for return vs yield usage in DoFn.process()#34912

Merged
damccorm merged 8 commits intoapache:masterfrom
YashaswiniTB:return/yield_documentation
Sep 8, 2025
Merged

Added documentation for return vs yield usage in DoFn.process()#34912
damccorm merged 8 commits intoapache:masterfrom
YashaswiniTB:return/yield_documentation

Conversation

@YashaswiniTB
Copy link
Contributor

Issue Link : #34906
Please add a meaningful description for your change here


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.

@YashaswiniTB YashaswiniTB changed the title Add documentation for return vs yield usage in DoFn.process() Added documentation for return vs yield usage in DoFn.process() May 11, 2025
@github-actions
Copy link
Contributor

Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment assign set of reviewers

Copy link
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 for picking this up!

YashaswiniTB and others added 2 commits May 12, 2025 22:27
Co-authored-by: Danny McCormick <dannymccormick@google.com>
@YashaswiniTB
Copy link
Contributor Author

@damccorm kindly review the PR and approve it

Copy link
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.

Please also check the precommits which are automatically run. In this case, the whitespace precommit is failing because you have trailing whitespace in some of your lines


<span class="language-python">

> **Returning a single element (e.g., `return element`) is incorrect**
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please flip the order of the descriptions and the examples? Otherwise, I worry people will just read the example and follow it without seeing the description saying it is wrong

Copy link
Contributor

Choose a reason for hiding this comment

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

It does not look like you addressed this - please move the "Returning a single element" section to the back of the order

@github-actions
Copy link
Contributor

Assigning reviewers:

R: @damccorm for label website.

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).

@damccorm
Copy link
Contributor

waiting on author

@YashaswiniTB
Copy link
Contributor Author

waiting on author

Thanks @damccorm! I believe I’ve addressed all the comments. Please let me know if anything else is required

@derrickaw
Copy link
Collaborator

waiting on author

Copy link
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 lgtm other than 2 changes which I'll apply before merging

@damccorm damccorm merged commit a351c88 into apache:master Sep 8, 2025
6 checks passed
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.

4 participants