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

[BEAM-1251] print() is a function in Python 3 #6166

Merged
merged 3 commits into from
Aug 18, 2018

Conversation

cclauss
Copy link

@cclauss cclauss commented Aug 7, 2018

print() is a function in Python 3 # just like #4784, #5531, and #5890

@charlesccychen @holdenk @superbobry

Please add a meaningful description for your change here


Follow this checklist to help us incorporate your contribution quickly and easily:

  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

It will help us expedite review of your Pull Request if you tag someone (e.g. @username) to look at it.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- --- --- --- ---
Java Build Status Build Status Build Status Build Status Build Status Build Status Build Status
Python Build Status --- Build Status
Build Status
--- --- --- ---

@superbobry
Copy link
Contributor

There seem to be two more occurences

sdks/python/apache_beam/io/tfrecordio_test.py
65:# ...   print data

sdks/python/apache_beam/utils/annotations.py
44:    print arg1, '*', arg2, '=',
55:    print arg1, '*', arg2, '(the old way)=',
63:    print arg1, '*', arg2, '(the experimental way)=',
69:  print multiply(5, 6)
70:  print old_multiply(5,6)
71:  print exp_multiply(5,6)

@cclauss
Copy link
Author

cclauss commented Aug 8, 2018

Thanks @superbobry, those instances were in comments, not in live code but I have converted them for completeness.

Copy link
Contributor

@superbobry superbobry left a comment

Choose a reason for hiding this comment

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

LGTM!

@cclauss
Copy link
Author

cclauss commented Aug 18, 2018

@charlesccychen @holdenk Your reviews please?

@cclauss
Copy link
Author

cclauss commented Aug 18, 2018

@pabloem Your review please?

Copy link
Contributor

@charlesccychen charlesccychen 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.

@charlesccychen charlesccychen merged commit 6637a50 into apache:master Aug 18, 2018
@cclauss cclauss deleted the print_function branch August 18, 2018 21:52
@cclauss
Copy link
Author

cclauss commented Aug 19, 2018

@holdenk This is merged now but I am wondering how the testing did not catch this and how we can prevent similar regression in the future. https://github.com/apache/beam/blob/master/sdks/python/scripts/run_mini_py3lint.sh#L51 should be able to spot these as syntax errors but perhaps it is only look at a portion of the codebase instead of looking at all Python files in the repo. On Travis, it takes 20 sec to do this flake8 test on the entire repo.

@tvalentyn
Copy link
Contributor

tvalentyn commented Aug 20, 2018

utils module is included py3 lint checks.

apache_beam/utils

I think the tools did not catch it because the occurrences are in the comment.

@cclauss
Copy link
Author

cclauss commented Aug 20, 2018

The first three files contained print statements in live code. These files are in .test-infra/jenkins which flake8 does not currently test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants