Ë
    ðmxiÎ  ã                  óx   — d dl mZ d dlmZmZmZmZ d dlmZm	Z	 erd dl
mZ  edd¬«      Z G d„ d	ee   «      Zy
)é    )Úannotations)ÚTYPE_CHECKINGÚCallableÚGenericÚTypeVar)ÚExprKindÚExprNode)ÚExprÚExprTr
   )Úboundc                  óD   — e Zd Zd	d„Zd
d„Zdd„Zdd„Zdd„Zd
d„Zd
d„Z	y)ÚExprNameNamespacec                ó   — || _         y )N)Ú_expr)ÚselfÚexprs     úI/home/htdocs/ttos/venv/lib/python3.12/site-packages/narwhals/expr_name.pyÚ__init__zExprNameNamespace.__init__   s	   € Øˆ�
ó    c                óh   — | j                   j                  t        t        j                  d«      «      S )aö  Keep the original root name of the 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']
        z	name.keep©r   Ú_append_noder	   r   ÚELEMENTWISE©r   s    r   ÚkeepzExprNameNamespace.keep   s&   € ð �z‰z×&Ñ&¤x´×0DÑ0DÀkÓ'RÓSÐSr   c                ól   — | j                   j                  t        t        j                  d|¬«      «      S )a¸  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.

        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']
        zname.map)Úfunctionr   )r   r   s     r   ÚmapzExprNameNamespace.map!   s-   € ð$ �z‰z×&Ñ&Ü”X×)Ñ)¨:ÀÔIó
ð 	
r   c                ól   — | j                   j                  t        t        j                  d|¬«      «      S )aj  Add a prefix to the root column name of the expression.

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

        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']
        zname.prefix)Úprefixr   )r   r    s     r   r    zExprNameNamespace.prefix7   ó-   € ð" �z‰z×&Ñ&Ü”X×)Ñ)¨=ÀÔHó
ð 	
r   c                ól   — | j                   j                  t        t        j                  d|¬«      «      S )am  Add a suffix to the root column name of the expression.

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

        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']
        zname.suffix)Úsuffixr   )r   r#   s     r   r#   zExprNameNamespace.suffixL   r!   r   c                óh   — | j                   j                  t        t        j                  d«      «      S )aè  Make the root column name lowercase.

        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']
        zname.to_lowercaser   r   s    r   Úto_lowercasezExprNameNamespace.to_lowercasea   ó,   € ð �z‰z×&Ñ&Ü”X×)Ñ)Ð+>Ó?ó
ð 	
r   c                óh   — | j                   j                  t        t        j                  d«      «      S )aè  Make the root column name uppercase.

        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']
        zname.to_uppercaser   r   s    r   Úto_uppercasezExprNameNamespace.to_uppercases   r&   r   N)r   r   ÚreturnÚNone)r)   r   )r   zCallable[[str], str]r)   r   )r    Ústrr)   r   )r#   r+   r)   r   )
Ú__name__Ú
__module__Ú__qualname__r   r   r   r    r#   r%   r(   © r   r   r   r      s&   „ óóTó 
ó,
ó*
ó*
ô$
r   r   N)Ú
__future__r   Útypingr   r   r   r   Únarwhals._expression_parsingr   r	   Únarwhals.exprr
   r   r   r/   r   r   ú<module>r4      s5   ðÝ "ç <Ó <ç ;áÝ"á�˜vÔ&€ôv
˜ ™õ v
r   