From 4b5b977ff7e29b4f29736e32696048a22cd771b3 Mon Sep 17 00:00:00 2001 From: abhishek bafna Date: Mon, 6 Jul 2020 11:12:21 +0530 Subject: [PATCH] EWT-370: Use python3 to launch the dataflow job. (#53) --- airflow/contrib/hooks/gcp_dataflow_hook.py | 2 +- airflow/version.py | 2 +- tests/contrib/hooks/test_gcp_dataflow_hook.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/airflow/contrib/hooks/gcp_dataflow_hook.py b/airflow/contrib/hooks/gcp_dataflow_hook.py index 6666d2fc7b7fd..f9ad004347920 100644 --- a/airflow/contrib/hooks/gcp_dataflow_hook.py +++ b/airflow/contrib/hooks/gcp_dataflow_hook.py @@ -242,7 +242,7 @@ def start_python_dataflow(self, job_name, variables, dataflow, py_options, def label_formatter(labels_dict): return ['--labels={}={}'.format(key, value) for key, value in labels_dict.items()] - self._start_dataflow(variables, name, ["python2"] + py_options + [dataflow], + self._start_dataflow(variables, name, ["python3"] + py_options + [dataflow], label_formatter) @staticmethod diff --git a/airflow/version.py b/airflow/version.py index 4dde17d493f17..de8dbaefeffbf 100644 --- a/airflow/version.py +++ b/airflow/version.py @@ -18,5 +18,5 @@ # under the License. # -version = '1.10.4+twtr12' +version = '1.10.4+twtr13' diff --git a/tests/contrib/hooks/test_gcp_dataflow_hook.py b/tests/contrib/hooks/test_gcp_dataflow_hook.py index 149b455a7c3e3..6eee81be2852b 100644 --- a/tests/contrib/hooks/test_gcp_dataflow_hook.py +++ b/tests/contrib/hooks/test_gcp_dataflow_hook.py @@ -102,7 +102,7 @@ def test_start_python_dataflow(self, mock_conn, self.dataflow_hook.start_python_dataflow( job_name=JOB_NAME, variables=DATAFLOW_OPTIONS_PY, dataflow=PY_FILE, py_options=PY_OPTIONS) - EXPECTED_CMD = ['python2', '-m', PY_FILE, + EXPECTED_CMD = ['python3', '-m', PY_FILE, '--region=us-central1', '--runner=DataflowRunner', '--project=test', '--labels=foo=bar',