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/06/02 16:28:56 UTC

[GitHub] [beam] kennknowles commented on a change in pull request #11835: Various fixes to allow Java PAssert to run on Python

kennknowles commented on a change in pull request #11835:
URL: https://github.com/apache/beam/pull/11835#discussion_r434012668



##########
File path: sdks/python/apache_beam/transforms/trigger_test.py
##########
@@ -518,6 +519,28 @@ def format_result(k_v):
                   'B-3': {10, 15, 16},
               }.items())))
 
+  def test_never(self):
+    with TestPipeline() as p:
+
+      def construct_timestamped(k_t):
+        return TimestampedValue((k_t[0], k_t[1]), k_t[1])
+
+      def format_result(k_v):
+        return ('%s-%s' % (k_v[0], len(k_v[1])), set(k_v[1]))
+
+      result = (
+          p
+          | beam.Create([1, 1, 2, 3, 4, 5, 10, 11])
+          | beam.FlatMap(lambda t: [('A', t), ('B', t + 5)])
+          | beam.Map(construct_timestamped)
+          | beam.WindowInto(
+              FixedWindows(10),
+              trigger=Never(),
+              accumulation_mode=AccumulationMode.DISCARDING)
+          | beam.GroupByKey()
+          | beam.Map(format_result))
+      assert_that(result, equal_to([]))

Review comment:
       Good point about that in PAssert. Though isn't the triggering just "fire at GC" and the windowing nothing special? Previously, it depended on side inputs which tend to come later in a runner's lifecycle.




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