def expand(self, pcoll): return (pcoll | 'TopPerMonthWindow' >> beam.WindowInto( FixedWindows(size=THIRTY_DAYS_IN_SECONDS)) | 'Top' >> combiners.core.CombineGlobally( combiners.TopCombineFn( 10, lambda first, second: first[1] < second[1])). without_defaults())
def expand(self, pcoll): return (pcoll | 'TopPerMonthWindow' >> beam.WindowInto( FixedWindows(size=THIRTY_DAYS_IN_SECONDS)) | 'Top' >> combiners.core.CombineGlobally( combiners.TopCombineFn( n=10, key=lambda sessions_count: sessions_count[1])). without_defaults())