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