[ https://issues.apache.org/jira/browse/BEAM-1251?focusedWorklogId=136006&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-136006 ]
ASF GitHub Bot logged work on BEAM-1251: ---------------------------------------- Author: ASF GitHub Bot Created on: 18/Aug/18 21:49 Start Date: 18/Aug/18 21:49 Worklog Time Spent: 10m Work Description: charlesccychen closed pull request #6166: [BEAM-1251] print() is a function in Python 3 URL: https://github.com/apache/beam/pull/6166 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/.test-infra/jenkins/dependency_check/dependency_check_report_generator_test.py b/.test-infra/jenkins/dependency_check/dependency_check_report_generator_test.py index b89907581f5..b4281cc5dd3 100644 --- a/.test-infra/jenkins/dependency_check/dependency_check_report_generator_test.py +++ b/.test-infra/jenkins/dependency_check/dependency_check_report_generator_test.py @@ -19,6 +19,7 @@ # This script performs testing of scenarios from verify_performance_test_results.py # +from __future__ import print_function import unittest, mock from mock import patch, mock_open from datetime import datetime @@ -44,7 +45,7 @@ class DependencyCheckReportGeneratorTest(unittest.TestCase): """Tests for `dependency_check_report_generator.py`.""" def setUp(self): - print "\n\nTest : " + self._testMethodName + print("\n\nTest : " + self._testMethodName) @patch('dependency_check.bigquery_client_utils.BigQueryClientUtils') @@ -134,4 +135,4 @@ def test_invalid_dep_input(self, *args): if __name__ == '__main__': unittest.main() - \ No newline at end of file + diff --git a/.test-infra/jenkins/jira_utils/jira_manager.py b/.test-infra/jenkins/jira_utils/jira_manager.py index cdc4450d106..70daf0cd44c 100644 --- a/.test-infra/jenkins/jira_utils/jira_manager.py +++ b/.test-infra/jenkins/jira_utils/jira_manager.py @@ -1,3 +1,4 @@ +from __future__ import print_function # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with @@ -66,7 +67,7 @@ def run(self, dep_name, dep_latest_version, sdk_type, group_id=None): Created a parent issue for {1}""".format(summary, group_id)) try: parent_issue = self._create_issue(group_id, None) - print parent_issue.key + print(parent_issue.key) except: logging.error("""Failed creating a parent issue for {0}. Stop handling the JIRA issue for {1}, {2}""".format(group_id, dep_name, dep_latest_version)) diff --git a/.test-infra/jenkins/jira_utils/jira_manager_test.py b/.test-infra/jenkins/jira_utils/jira_manager_test.py index 15677d08bb3..dcf11a69e5c 100644 --- a/.test-infra/jenkins/jira_utils/jira_manager_test.py +++ b/.test-infra/jenkins/jira_utils/jira_manager_test.py @@ -1,3 +1,4 @@ +from __future__ import print_function # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with @@ -42,7 +43,7 @@ class JiraManagerTest(unittest.TestCase): """Tests for `jira_manager.py`.""" def setUp(self): - print "\n\nTest : " + self._testMethodName + print("\n\nTest : " + self._testMethodName) def test_find_owners_with_single_owner(self, *args): @@ -240,4 +241,3 @@ def _get_expected_description(self, dep_name, dep_latest_version, owners): if __name__ == '__main__': unittest.main() - diff --git a/sdks/python/apache_beam/io/tfrecordio_test.py b/sdks/python/apache_beam/io/tfrecordio_test.py index ded8d794159..dfc660d2ec0 100644 --- a/sdks/python/apache_beam/io/tfrecordio_test.py +++ b/sdks/python/apache_beam/io/tfrecordio_test.py @@ -62,7 +62,7 @@ # >>> writer.close() # >>> with open('/tmp/python_foo.tfrecord', 'rb') as f: # ... data = base64.b64encode(f.read()) -# ... print data +# ... print(data) FOO_RECORD_BASE64 = 'AwAAAAAAAACwmUkOZm9vYYq+/g==' # Same as above but containing two records ['foo', 'bar'] diff --git a/sdks/python/apache_beam/utils/annotations.py b/sdks/python/apache_beam/utils/annotations.py index 7ec7150d174..29121329fc2 100644 --- a/sdks/python/apache_beam/utils/annotations.py +++ b/sdks/python/apache_beam/utils/annotations.py @@ -41,7 +41,7 @@ same function 'multiply'.:: def multiply(arg1, arg2): - print arg1, '*', arg2, '=', + print(arg1, '*', arg2, '=', end=' ') return arg1*arg2 # This annotation marks 'old_multiply' as deprecated since 'v.1' and suggests @@ -52,7 +52,7 @@ def old_multiply(arg1, arg2): result = 0 for i in xrange(arg1): result += arg2 - print arg1, '*', arg2, '(the old way)=', + print(arg1, '*', arg2, '(the old way)=', end=' ') return result # This annotation marks 'exp_multiply' as experimental and suggests @@ -60,15 +60,15 @@ def old_multiply(arg1, arg2): @experimental(since='v.1', current='multiply') def exp_multiply(arg1, arg2): - print arg1, '*', arg2, '(the experimental way)=', + print(arg1, '*', arg2, '(the experimental way)=', end=' ') return (arg1*arg2)*(arg1/arg2)*(arg2/arg1) # Set a warning filter to control how often warnings are produced.:: warnings.simplefilter("always") - print multiply(5, 6) - print old_multiply(5,6) - print exp_multiply(5,6) + print(multiply(5, 6)) + print(old_multiply(5,6)) + print(exp_multiply(5,6)) """ from __future__ import absolute_import ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 136006) Time Spent: 19.5h (was: 19h 20m) > Python 3 Support > ---------------- > > Key: BEAM-1251 > URL: https://issues.apache.org/jira/browse/BEAM-1251 > Project: Beam > Issue Type: Improvement > Components: sdk-py-core > Reporter: Eyad Sibai > Assignee: Robbe > Priority: Major > Time Spent: 19.5h > Remaining Estimate: 0h > > I have been trying to use google datalab with python3. As I see there are > several packages that does not support python3 yet which google datalab > depends on. This is one of them. > https://github.com/GoogleCloudPlatform/DataflowPythonSDK/issues/6 -- This message was sent by Atlassian JIRA (v7.6.3#76005)