
    hh                    x    d dl mZ d dlmZmZmZ erd dlmZ  edd          Z G d dee                   Z	d	S )
    )annotations)TYPE_CHECKINGGenericTypeVar)ExprExprTr   )boundc                      e Zd Zd
dZddZd	S )ExprStructNamespaceexprr   returnNonec                    || _         d S N)_expr)selfr   s     K/var/www/histauto/venv/lib/python3.11/site-packages/narwhals/expr_struct.py__init__zExprStructNamespace.__init__   s    


    namestrc                B      j                              fd          S )u  Retrieve a Struct field as a new expression.

        Arguments:
            name: Name of the struct field to retrieve.

        Examples:
            >>> import polars as pl
            >>> import narwhals as nw
            >>> df_native = pl.DataFrame(
            ...     {"user": [{"id": "0", "name": "john"}, {"id": "1", "name": "jane"}]}
            ... )
            >>> df = nw.from_native(df_native)
            >>> df.with_columns(name=nw.col("user").struct.field("name"))
            ┌───────────────────────┐
            |  Narwhals DataFrame   |
            |-----------------------|
            |shape: (2, 2)          |
            |┌──────────────┬──────┐|
            |│ user         ┆ name │|
            |│ ---          ┆ ---  │|
            |│ struct[2]    ┆ str  │|
            |╞══════════════╪══════╡|
            |│ {"0","john"} ┆ john │|
            |│ {"1","jane"} ┆ jane │|
            |└──────────────┴──────┘|
            └───────────────────────┘
        c                h    j                             |           j                                      S r   )r   _to_compliant_exprstructfield)plxr   r   s    r   <lambda>z+ExprStructNamespace.field.<locals>.<lambda>,   s(    
55c::AGGMM r   )r   _with_elementwise)r   r   s   ``r   r   zExprStructNamespace.field   s/    8 z++MMMMM
 
 	
r   N)r   r   r   r   )r   r   r   r   )__name__
__module____qualname__r   r    r   r   r   r      s<           
 
 
 
 
 
r   r   N)

__future__r   typingr   r   r   narwhals.exprr   r   r   r#   r   r   <module>r'      s    " " " " " " 2 2 2 2 2 2 2 2 2 2 #""""""v&&&"
 "
 "
 "
 "
'%. "
 "
 "
 "
 "
r   