
    h"                    l    S SK Jr  S SKJrJrJrJr  \(       a  S SKJr  \" SSS9r	 " S S\\	   5      r
g	)
    )annotations)TYPE_CHECKINGCallableGenericTypeVar)ExprExprTr   )boundc                  Z    \ rS rSrSS jrSS jrSS jrSS jrSS jrSS jr	SS jr
S	rg
)ExprNameNamespace   c                    Xl         g N_expr)selfexprs     eC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\narwhals/expr_name.py__init__ExprNameNamespace.__init__   s    
    c                B   ^  T R                   R                  U 4S j5      $ )a  Keep the original root name of the expression.

Returns:
    A new expression.

Notes:
    For Polars versions prior to 1.32, this will undo any previous renaming operations on the expression.

Examples:
    >>> import pandas as pd
    >>> import narwhals as nw
    >>> df_native = pd.DataFrame({"foo": [1, 2], "BAR": [4, 5]})
    >>> df = nw.from_native(df_native)
    >>> df.select(nw.col("foo").alias("alias_for_foo").name.keep()).columns
    ['foo']
c                j   > TR                   R                  U 5      R                  R                  5       $ r   )r   _to_compliant_exprnamekeepplxr   s    r   <lambda>(ExprNameNamespace.keep.<locals>.<lambda>!   s#    

55c:??DDFr   r   _with_elementwiser   s   `r   r   ExprNameNamespace.keep   s    " zz++F
 	
r   c                F   ^ ^ T R                   R                  UU 4S j5      $ )ap  Rename the output of an expression by mapping a function over the root name.

Arguments:
    function: Function that maps a root name to a new name.

Returns:
    A new expression.

Notes:
    For Polars versions prior to 1.32, this will undo any previous renaming operations on the expression.

Examples:
    >>> import pandas as pd
    >>> import narwhals as nw
    >>> df_native = pd.DataFrame({"foo": [1, 2], "BAR": [4, 5]})
    >>> df = nw.from_native(df_native)
    >>> renaming_func = lambda s: s[::-1]  # reverse column name
    >>> df.select(nw.col("foo", "BAR").name.map(renaming_func)).columns
    ['oof', 'RAB']
c                l   > TR                   R                  U 5      R                  R                  T5      $ r   )r   r   r   map)r   functionr   s    r   r   'ExprNameNamespace.map.<locals>.<lambda>:   s%    

55c:??CCHMr   r!   )r   r(   s   ``r   r'   ExprNameNamespace.map$   s    * zz++M
 	
r   c                F   ^ ^ T R                   R                  UU 4S j5      $ )a*  Add a prefix to the root column name of the expression.

Arguments:
    prefix: Prefix to add to the root column name.

Returns:
    A new expression.

Notes:
    For Polars versions prior to 1.32, this will undo any previous renaming operations on the expression.

Examples:
    >>> import polars as pl
    >>> import narwhals as nw
    >>> df_native = pl.DataFrame({"foo": [1, 2], "BAR": [4, 5]})
    >>> df = nw.from_native(df_native)
    >>> df.select(nw.col("foo", "BAR").name.prefix("with_prefix")).columns
    ['with_prefixfoo', 'with_prefixBAR']
c                l   > TR                   R                  U 5      R                  R                  T5      $ r   )r   r   r   prefix)r   r-   r   s    r   r   *ExprNameNamespace.prefix.<locals>.<lambda>R   %    

55c:??FFvNr   r!   )r   r-   s   ``r   r-   ExprNameNamespace.prefix=       ( zz++N
 	
r   c                F   ^ ^ T R                   R                  U U4S j5      $ )a-  Add a suffix to the root column name of the expression.

Arguments:
    suffix: Suffix to add to the root column name.

Returns:
    A new expression.

Notes:
    For Polars versions prior to 1.32, this will undo any previous renaming operations on the expression.

Examples:
    >>> import polars as pl
    >>> import narwhals as nw
    >>> df_native = pl.DataFrame({"foo": [1, 2], "BAR": [4, 5]})
    >>> df = nw.from_native(df_native)
    >>> df.select(nw.col("foo", "BAR").name.suffix("_with_suffix")).columns
    ['foo_with_suffix', 'BAR_with_suffix']
c                l   > TR                   R                  U 5      R                  R                  T5      $ r   )r   r   r   suffix)r   r   r4   s    r   r   *ExprNameNamespace.suffix.<locals>.<lambda>j   r/   r   r!   )r   r4   s   ``r   r4   ExprNameNamespace.suffixU   r1   r   c                B   ^  T R                   R                  U 4S j5      $ )a  Make the root column name lowercase.

Returns:
    A new expression.

Notes:
    For Polars versions prior to 1.32, this will undo any previous renaming operations on the expression.

Examples:
    >>> import pyarrow as pa
    >>> import narwhals as nw
    >>> df_native = pa.table({"foo": [1, 2], "BAR": [4, 5]})
    >>> df = nw.from_native(df_native)
    >>> df.select(nw.col("foo", "BAR").name.to_lowercase()).columns
    ['foo', 'bar']
c                j   > TR                   R                  U 5      R                  R                  5       $ r   )r   r   r   to_lowercaser   s    r   r   0ExprNameNamespace.to_lowercase.<locals>.<lambda>   #    

55c:??LLNr   r!   r#   s   `r   r9   ExprNameNamespace.to_lowercasem       " zz++N
 	
r   c                B   ^  T R                   R                  U 4S j5      $ )a  Make the root column name uppercase.

Returns:
    A new expression.

Notes:
    For Polars versions prior to 1.32, this will undo any previous renaming operations on the expression.

Examples:
    >>> import pyarrow as pa
    >>> import narwhals as nw
    >>> df_native = pa.table({"foo": [1, 2], "BAR": [4, 5]})
    >>> df = nw.from_native(df_native)
    >>> df.select(nw.col("foo", "BAR").name.to_uppercase()).columns
    ['FOO', 'BAR']
c                j   > TR                   R                  U 5      R                  R                  5       $ r   )r   r   r   to_uppercaser   s    r   r   0ExprNameNamespace.to_uppercase.<locals>.<lambda>   r;   r   r!   r#   s   `r   r@   ExprNameNamespace.to_uppercase   r=   r   r   N)r   r	   returnNone)rC   r	   )r(   zCallable[[str], str]rC   r	   )r-   strrC   r	   )r4   rE   rC   r	   )__name__
__module____qualname____firstlineno__r   r   r'   r-   r4   r9   r@   __static_attributes__ r   r   r   r      s%    
*
2
0
0
*
r   r   N)
__future__r   typingr   r   r   r   narwhals.exprr   r	   r   rK   r   r   <module>rO      s2    " < <"v&J
 J
r   