You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/04/13 22:37:44 UTC

[GitHub] [beam] robertwb commented on a change in pull request #11335: [BEAM-9692]: Make CombineValues portable

robertwb commented on a change in pull request #11335: [BEAM-9692]: Make CombineValues portable
URL: https://github.com/apache/beam/pull/11335#discussion_r407758508
 
 

 ##########
 File path: sdks/python/apache_beam/runners/dataflow/dataflow_runner_test.py
 ##########
 @@ -566,6 +566,19 @@ def test_get_default_gcp_region_ignores_error(
     result = runner.get_default_gcp_region()
     self.assertIsNone(result)
 
+  def test_combine_values_translation(self):
+    runner = DataflowRunner()
+
+    with beam.Pipeline(runner=runner,
+                       options=PipelineOptions(self.default_properties)) as p:
+      (  # pylint: disable=expression-not-assigned
+          p
+          | beam.Create([('a', [1, 2]), ('b', [3, 4])])
+          | beam.CombineValues(lambda v, _: sum(v)))
+
+    job_dict = json.loads(str(runner.job))
+    self.assertEqual(job_dict[u'steps'][1][u'kind'], u'CombineValues')
 
 Review comment:
   Asserting that it's the first step seems brittle, maybe just assert that there is some step that has this kind?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services