(func_ir, rhs, get_consts=True)
return window, center, on
Handle Series rolling calls like:
        r = df.column.rolling(3)
Handle Series rolling calls like:
        r = df.column.rolling(3)
Handle Series rolling calls like : r = df . column . rolling ( 3 )
def get_rolling_setup_args(func_ir, rhs, get_consts=True):
    """
    Handle Series rolling calls like:
        r = df.column.rolling(3)
    """
    center = False
    on = None
    kws = dict(rhs.kws)
    if rhs.args:
        window = rhs.args[0]
    elif 'window' in kws:
        window = kws['window']
    else:  # pragma: no cover
        raise ValueError("window argument to rolling() required")
    if get_consts:
        window_const = guard(find_const, func_ir, window)
        window = window_const if window_const is not None else window
    if 'center' in kws:
        center = kws['center']
        if get_consts:
            center_const = guard(find_const, func_ir, center)
            center = center_const if center_const is not None else center
    if 'on' in kws:
        on = guard(find_const, func_ir, kws['on'])
        if on is None:
            raise ValueError("'on' argument to rolling() should be constant string")
    # convert string offset window statically to nanos
    # TODO: support dynamic conversion
    # TODO: support other offsets types (time delta, etc.)
    if on is not None:
        window = guard(find_const, func_ir, window)
        if not isinstance(window, str):
            raise ValueError("window argument to rolling should be constant"
                             "string in the offset case (variable window)")
        window = pd.tseries.frequencies.to_offset(window).nanos
    return window, center, on
def get_rolling_setup_args ( func_ir , rhs , get_consts = True ) : center = False on = None kws = dict ( rhs . kws ) if rhs . args : window = rhs . args [ 0 ] elif 'window' in kws : window = kws [ 'window' ] else : # pragma: no cover raise ValueError ( "window argument to rolling() required" ) if get_consts : window_const = guard ( find_const , func_ir , window ) window = window_const if window_const is not None else window if 'center' in kws : center = kws [ 'center' ] if get_consts : center_const = guard ( find_const , func_ir , center ) center = center_const if center_const is not None else center if 'on' in kws : on = guard ( find_const , func_ir , kws [ 'on' ] ) if on is None : raise ValueError ( "'on' argument to rolling() should be constant string" ) # convert string offset window statically to nanos # TODO: support dynamic conversion # TODO: support other offsets types (time delta, etc.) if on is not None : window = guard ( find_const , func_ir , window ) if not isinstance ( window , str ) : raise ValueError ( "window argument to rolling should be constant" "string in the offset case (variable window)" ) window = pd . tseries . frequencies . to_offset ( window ) . nanos return window , center , on