Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log a warning, if the process method of DoFn returns None #28159

Conversation

timgrein
Copy link
Contributor

@timgrein timgrein commented Aug 25, 2023

Addresses #28061

This PR adds a warning log, if the process method of DoFn returns None by checking the following cases (doesn't check inner functions):

  • process contains return None (explicit return None)
  • process contains only return (implicit return None)
  • process doesn't contain yield neither does it contain return (implicit return None)

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.

@codecov
Copy link

codecov bot commented Aug 25, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6bfb469) 72.31% compared to head (447a7f3) 72.30%.
Report is 1493 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #28159      +/-   ##
==========================================
- Coverage   72.31%   72.30%   -0.02%     
==========================================
  Files         678      678              
  Lines       99802    99815      +13     
==========================================
- Hits        72171    72170       -1     
- Misses      26069    26083      +14     
  Partials     1562     1562              
Flag Coverage Δ
python 82.85% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@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

@github-actions
Copy link
Contributor

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

R: @AnandInguva for label python.

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

Comment on lines 1426 to 1427
return_none_warning = "No iterator is returned by " \
"the process method in DoFn."
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return_none_warning = "No iterator is returned by " \
"the process method in DoFn."
return_none_warning = ("No iterator is returned by "
"the process method in DoFn.")

Copy link
Contributor

Choose a reason for hiding this comment

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

This warning could be meaningful if it can mention the faulty DoFn. Can we add the name of the DoFn?

Copy link
Contributor Author

@timgrein timgrein Aug 26, 2023

Choose a reason for hiding this comment

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

Added the class name using fn.__self__.__class__ 👍

@AnandInguva
Copy link
Contributor

The pydocs are getting this error 04:42:45 WARNING:apache_beam.transforms.core:('No iterator is returned by the process method in %s.', <class 'apache_beam.transforms.core.WindowInto.WindowIntoFn'>) for this DoFn.

class WindowIntoFn(DoFn):

Can you check it why since the DoFn is returning yield?

@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2023

Reminder, please take a look at this pr: @AnandInguva

@timgrein
Copy link
Contributor Author

timgrein commented Sep 5, 2023

The pydocs are getting this error 04:42:45 WARNING:apache_beam.transforms.core:('No iterator is returned by the process method in %s.', <class 'apache_beam.transforms.core.WindowInto.WindowIntoFn'>) for this DoFn.

class WindowIntoFn(DoFn):

Can you check it why since the DoFn is returning yield?

Taking a look today or tomorrow 👍

@github-actions
Copy link
Contributor

Reminder, please take a look at this pr: @AnandInguva

@github-actions
Copy link
Contributor

Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment assign to next reviewer:

R: @damccorm for label python.

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)

@damccorm
Copy link
Contributor

Hey @timgrein any update on this one?

@damccorm
Copy link
Contributor

@timgrein any updates here?

Copy link
Contributor

This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions.

@github-actions github-actions bot added stale and removed stale labels Feb 11, 2024
Copy link
Contributor

This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Apr 13, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.30%. Comparing base (6bfb469) to head (447a7f3).
Report is 1959 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #28159      +/-   ##
==========================================
- Coverage   72.31%   72.30%   -0.02%     
==========================================
  Files         678      678              
  Lines       99802    99815      +13     
==========================================
- Hits        72171    72170       -1     
- Misses      26069    26083      +14     
  Partials     1562     1562              
Flag Coverage Δ
python 82.85% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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