You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "robertwb (via GitHub)" <gi...@apache.org> on 2023/03/22 16:55:57 UTC

[GitHub] [beam] robertwb commented on a diff in pull request #25935: Add a source and sink option to yaml pipelines.

robertwb commented on code in PR #25935:
URL: https://github.com/apache/beam/pull/25935#discussion_r1145142345


##########
sdks/python/apache_beam/yaml/yaml_transform_test.py:
##########
@@ -68,6 +68,25 @@ def test_chain_with_input(self):
           ''')
       assert_that(result, equal_to([41, 43, 47, 53, 61, 71, 83, 97, 113, 131]))
 
+  def test_chain_with_source_sink(self):
+    with beam.Pipeline(options=beam.options.pipeline_options.PipelineOptions(
+        pickle_library='cloudpickle')) as p:
+      elements = p | beam.Create(range(10))
+      result = elements | YamlTransform(
+          '''
+          type: chain
+          source:
+            type: Create
+            elements: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+          transforms:
+            - type: PyMap
+              fn: "lambda x: x * x + x"
+          sink:

Review Comment:
   Sinks can have outputs (e.g. the actual files written or other metadata). Here I'm using a map as the sink to be able to test it.



-- 
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.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org