예제 #1
0
 def test_combine_globally_without_default(self):
     with TestPipeline() as p:
         result = p | Create([]) | CombineGlobally(sum).without_defaults()
         assert_that(result, equal_to([]))
예제 #2
0
 def expand(self, pcoll):
     side = pcoll | CombineGlobally(sum).as_singleton_view()
     main = pcoll.pipeline | Create([None])
     return main | Map(lambda _, s: s, side)
예제 #3
0
 def test_combine_globally_with_default(self):
     with TestPipeline() as p:
         assert_that(p | Create([]) | CombineGlobally(sum), equal_to([0]))