def row_number(expr, sort=None, ascending=True):
    """
    Calculate row number of a sequence expression.

    :param expr: expression for calculation
    :param sort: name of the sort column
    :param ascending: whether to sort in ascending order
    :return: calculated column
    """
    return _rank_op(expr, RowNumber, types.int64, sort=sort, ascending=ascending)
Calculate row number of a sequence expression.

    :param expr: expression for calculation
    :param sort: name of the sort column
    :param ascending: whether to sort in ascending order
    :return: calculated column