This is an automated email from the ASF dual-hosted git repository.
ccy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new 6f207aa Allow Python 3.6 jobs on DataflowRunner
new 2c3be51 Merge pull request #7966 from charlesccychen/allow-36
6f207aa is described below
commit 6f207aa3d659dde4cde30ad39e87dfcadc289749
Author: Charles Chen <[email protected]>
AuthorDate: Thu Feb 28 10:51:39 2019 -0800
Allow Python 3.6 jobs on DataflowRunner
---
.../apache_beam/runners/dataflow/internal/apiclient.py | 8 ++++----
.../apache_beam/runners/dataflow/internal/apiclient_test.py | 12 ++++++------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/sdks/python/apache_beam/runners/dataflow/internal/apiclient.py
b/sdks/python/apache_beam/runners/dataflow/internal/apiclient.py
index 1903982..b03a8bb 100644
--- a/sdks/python/apache_beam/runners/dataflow/internal/apiclient.py
+++ b/sdks/python/apache_beam/runners/dataflow/internal/apiclient.py
@@ -957,10 +957,10 @@ def
_verify_interpreter_version_is_supported(pipeline_options):
if sys.version_info[0] == 2:
return
- if sys.version_info[0] == 3 and sys.version_info[1] == 5:
- if sys.version_info[2] < 3:
+ if sys.version_info[0:2] in [(3, 5), (3, 6)]:
+ if sys.version_info[0:3] < (3, 5, 3):
warnings.warn(
- 'You are using an early release of Python 3.5. It is recommended '
+ 'You are using an early release for Python 3.5. It is recommended '
'to use Python 3.5.3 or higher with Dataflow '
'runner.')
return
@@ -972,7 +972,7 @@ def
_verify_interpreter_version_is_supported(pipeline_options):
raise Exception(
'Dataflow runner currently supports Python versions '
- '2.7 and 3.5. To ignore this requirement and start a job using a '
+ '2.7, 3.5 and 3.6. To ignore this requirement and start a job using a '
'different version of Python 3 interpreter, pass '
'--experiment ignore_py3_minor_version pipeline option.')
diff --git
a/sdks/python/apache_beam/runners/dataflow/internal/apiclient_test.py
b/sdks/python/apache_beam/runners/dataflow/internal/apiclient_test.py
index 0d8fc43..9e11035 100644
--- a/sdks/python/apache_beam/runners/dataflow/internal/apiclient_test.py
+++ b/sdks/python/apache_beam/runners/dataflow/internal/apiclient_test.py
@@ -456,7 +456,7 @@ class UtilTest(unittest.TestCase):
@mock.patch(
'apache_beam.runners.dataflow.internal.apiclient.sys.version_info',
- [2, 333])
+ (2, 333))
def test_get_python_sdk_name(self):
pipeline_options = PipelineOptions(
['--project', 'test_project', '--job_name', 'test_job_name',
@@ -470,28 +470,28 @@ class UtilTest(unittest.TestCase):
@mock.patch(
'apache_beam.runners.dataflow.internal.apiclient.sys.version_info',
- [2, 7])
+ (2, 7))
def test_interpreter_version_check_passes_py27(self):
pipeline_options = PipelineOptions([])
apiclient._verify_interpreter_version_is_supported(pipeline_options)
@mock.patch(
'apache_beam.runners.dataflow.internal.apiclient.sys.version_info',
- [3, 5, 2])
+ (3, 5, 2))
def test_interpreter_version_check_passes_py352(self):
pipeline_options = PipelineOptions([])
apiclient._verify_interpreter_version_is_supported(pipeline_options)
@mock.patch(
'apache_beam.runners.dataflow.internal.apiclient.sys.version_info',
- [3, 5, 6])
+ (3, 5, 6))
def test_interpreter_version_check_passes_py356(self):
pipeline_options = PipelineOptions([])
apiclient._verify_interpreter_version_is_supported(pipeline_options)
@mock.patch(
'apache_beam.runners.dataflow.internal.apiclient.sys.version_info',
- [3, 9, 0])
+ (3, 9, 0))
def test_interpreter_version_check_passes_with_experiment(self):
pipeline_options = PipelineOptions(
["--experiment=ignore_py3_minor_version"])
@@ -499,7 +499,7 @@ class UtilTest(unittest.TestCase):
@mock.patch(
'apache_beam.runners.dataflow.internal.apiclient.sys.version_info',
- [3, 9, 0])
+ (3, 9, 0))
def test_interpreter_version_check_fails_py39(self):
pipeline_options = PipelineOptions([])
self.assertRaises(