def __init__(self, gap_size): if gap_size <= 0: raise ValueError('The size parameter must be strictly positive.') self.gap_size = Duration.of(gap_size)
def __init__(self, size, period, offset=0): if size <= 0: raise ValueError('The size parameter must be strictly positive.') self.size = Duration.of(size) self.period = Duration.of(period) self.offset = Timestamp.of(offset) % size
def from_runner_api_parameter(fn_parameter, unused_context): return Sessions(gap_size=Duration(micros=fn_parameter['gap_size']))
def from_runner_api_parameter(fn_parameter, unused_context): return SlidingWindows(size=Duration(micros=fn_parameter['size']), offset=Timestamp(micros=fn_parameter['offset']), period=Duration(micros=fn_parameter['period']))