
    }i                        d dl mZ d dl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d
S )    )annotations)TYPE_CHECKINGGenericTypeVar)ExprKindExprNode)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     H/home/jrussi/.local/lib/python3.11/site-packages/narwhals/expr_struct.py__init__zExprStructNamespace.__init__   s    


    namestrc                j    | j                             t          t          j        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 │|
            |└──────────────┴──────┘|
            └───────────────────────┘
        zstruct.field)r   )r   _append_noder   r   ELEMENTWISE)r   r   s     r   fieldzExprStructNamespace.field   s3    8 z&&X)>EEE
 
 	
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._expression_parsingr   r   narwhals.exprr	   r
   r   r    r   r   <module>r%      s    " " " " " " 2 2 2 2 2 2 2 2 2 2 ; ; ; ; ; ; ; ; #""""""v&&&"
 "
 "
 "
 "
'%. "
 "
 "
 "
 "
r   