Λ
    WΛhΞ  γ                  σd    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	y	)
ι    )Ϊannotations)ΪTYPE_CHECKINGΪGenericΪTypeVar)ΪExprΪExprTr   )Ϊboundc                  σ    e Zd ZddZddZy)ΪExprStructNamespacec                σ    || _         y ©N)Ϊ_expr)ΪselfΪexprs     ϊN/var/www/html/jupyter_env/lib/python3.12/site-packages/narwhals/expr_struct.pyΪ__init__zExprStructNamespace.__init__   s	    Ψ
σ    c                σD      j                   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                σl    j                   j                  | «      j                  j                  «      S r   )r   Ϊ_to_compliant_exprΪstructΪfield)ΪplxΪnamer   s    r   ϊ<lambda>z+ExprStructNamespace.field.<locals>.<lambda>,   s'   ψ 

Χ5Ρ5°cΣ:ΧAΡAΧGΡGΘΣM r   )r   Ϊ_with_elementwise)r   r   s   ``r   r   zExprStructNamespace.field   s   ω π8 zzΧ+Ρ+άMσ
π 	
r   N)r   r   ΪreturnΪNone)r   Ϊstrr   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'      s0   πέ "η 2Ρ 2αέ"αvΤ&τ"
' %.υ "
r   