You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by al...@apache.org on 2017/10/21 01:04:35 UTC

[1/2] beam git commit: Unit test for label pipeline option

Repository: beam
Updated Branches:
  refs/heads/master 66fcda99c -> a71f00078


Unit test for label pipeline option


Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/3d6454ea
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/3d6454ea
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/3d6454ea

Branch: refs/heads/master
Commit: 3d6454ea51ec7fd5c756b4750791dea78dcdc21a
Parents: 66fcda9
Author: Ahmet Altay <al...@google.com>
Authored: Fri Oct 13 15:53:15 2017 -0700
Committer: Ahmet Altay <al...@google.com>
Committed: Fri Oct 20 18:04:22 2017 -0700

----------------------------------------------------------------------
 .../runners/dataflow/internal/apiclient_test.py | 28 ++++++++++++++++++++
 1 file changed, 28 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/beam/blob/3d6454ea/sdks/python/apache_beam/runners/dataflow/internal/apiclient_test.py
----------------------------------------------------------------------
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 ecd6003..79cbd1c 100644
--- a/sdks/python/apache_beam/runners/dataflow/internal/apiclient_test.py
+++ b/sdks/python/apache_beam/runners/dataflow/internal/apiclient_test.py
@@ -195,6 +195,34 @@ class UtilTest(unittest.TestCase):
         for experiment in env.proto.experiments:
           self.assertNotIn('runner_harness_container_image=', experiment)
 
+  def test_labels(self):
+    pipeline_options = PipelineOptions(
+        ['--project', 'test_project', '--job_name', 'test_job_name',
+         '--temp_location', 'gs://test-location/temp'])
+    job = apiclient.Job(pipeline_options)
+    self.assertIsNone(job.proto.labels)
+
+    pipeline_options = PipelineOptions(
+        ['--project', 'test_project', '--job_name', 'test_job_name',
+         '--temp_location', 'gs://test-location/temp',
+         '--label', 'key1=value1',
+         '--label', 'key2',
+         '--label', 'key3=value3',
+         '--labels', 'key4=value4',
+         '--labels', 'key5'])
+    job = apiclient.Job(pipeline_options)
+    self.assertEqual(5, len(job.proto.labels.additionalProperties))
+    self.assertEqual('key1', job.proto.labels.additionalProperties[0].key)
+    self.assertEqual('value1', job.proto.labels.additionalProperties[0].value)
+    self.assertEqual('key2', job.proto.labels.additionalProperties[1].key)
+    self.assertEqual('', job.proto.labels.additionalProperties[1].value)
+    self.assertEqual('key3', job.proto.labels.additionalProperties[2].key)
+    self.assertEqual('value3', job.proto.labels.additionalProperties[2].value)
+    self.assertEqual('key4', job.proto.labels.additionalProperties[3].key)
+    self.assertEqual('value4', job.proto.labels.additionalProperties[3].value)
+    self.assertEqual('key5', job.proto.labels.additionalProperties[4].key)
+    self.assertEqual('', job.proto.labels.additionalProperties[4].value)
+
 
 if __name__ == '__main__':
   unittest.main()


[2/2] beam git commit: This closes #3994

Posted by al...@apache.org.
This closes #3994


Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/a71f0007
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/a71f0007
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/a71f0007

Branch: refs/heads/master
Commit: a71f00078836e33f6aabc7b424f932f85d0ae80a
Parents: 66fcda9 3d6454e
Author: Ahmet Altay <al...@google.com>
Authored: Fri Oct 20 18:04:26 2017 -0700
Committer: Ahmet Altay <al...@google.com>
Committed: Fri Oct 20 18:04:26 2017 -0700

----------------------------------------------------------------------
 .../runners/dataflow/internal/apiclient_test.py | 28 ++++++++++++++++++++
 1 file changed, 28 insertions(+)
----------------------------------------------------------------------