def cumsum(expr, sort=None, ascending=True, unique=False,
           preceding=None, following=None):
    if expr._data_type == types.boolean:
        output_type = types.int64
    else:
        output_type = expr._data_type
    return _cumulative_op(expr, CumSum, sort=sort, ascending=ascending,
                          unique=unique, preceding=preceding,
                          following=following, data_type=output_type)