You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by cr...@apache.org on 2017/10/11 20:28:27 UTC

incubator-airflow git commit: [AIRFLOW-1696] Fix dataproc version label error

Repository: incubator-airflow
Updated Branches:
  refs/heads/master d578b292e -> 98b4df945


[AIRFLOW-1696] Fix dataproc version label error

Closes #2676 from TrevorEdwards/airflow-1696


Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/98b4df94
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/98b4df94
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/98b4df94

Branch: refs/heads/master
Commit: 98b4df945dec5dfe766c8a9a15cf4b3932bf1a5c
Parents: d578b29
Author: Trevor Edwards <tr...@google.com>
Authored: Wed Oct 11 13:28:13 2017 -0700
Committer: Chris Riccomini <cr...@apache.org>
Committed: Wed Oct 11 13:28:17 2017 -0700

----------------------------------------------------------------------
 airflow/contrib/operators/dataproc_operator.py    | 2 +-
 tests/contrib/operators/test_dataproc_operator.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/98b4df94/airflow/contrib/operators/dataproc_operator.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/operators/dataproc_operator.py b/airflow/contrib/operators/dataproc_operator.py
index 0823ed8..99e4a0d 100644
--- a/airflow/contrib/operators/dataproc_operator.py
+++ b/airflow/contrib/operators/dataproc_operator.py
@@ -241,7 +241,7 @@ class DataprocClusterCreateOperator(BaseOperator):
         # [a-z]([-a-z0-9]*[a-z0-9])? (current airflow version string follows
         # semantic versioning spec: x.y.z).
         cluster_data['labels'].update({'airflow-version':
-                                       'v' + version.replace('.', '-')})
+                                       'v' + version.replace('.', '-').replace('+','-')})
         if self.storage_bucket:
             cluster_data['config']['configBucket'] = self.storage_bucket
         if self.metadata:

http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/98b4df94/tests/contrib/operators/test_dataproc_operator.py
----------------------------------------------------------------------
diff --git a/tests/contrib/operators/test_dataproc_operator.py b/tests/contrib/operators/test_dataproc_operator.py
index d206fba..ad78a8d 100644
--- a/tests/contrib/operators/test_dataproc_operator.py
+++ b/tests/contrib/operators/test_dataproc_operator.py
@@ -129,7 +129,7 @@ class DataprocClusterCreateOperatorTest(unittest.TestCase):
             # set to the dataproc operator.
             merged_labels = {}
             merged_labels.update(self.labels[suffix])
-            merged_labels.update({'airflow-version': 'v' + version.replace('.', '-')})
+            merged_labels.update({'airflow-version': 'v' + version.replace('.', '-').replace('+','-')})
             self.assertTrue(re.match(r'[a-z]([-a-z0-9]*[a-z0-9])?',
                                      cluster_data['labels']['airflow-version']))
             self.assertEqual(cluster_data['labels'], merged_labels)