o
    h                     @  sp   d dl mZ d dlmZ d dlmZ d dlmZ d dlmZ er&d dlmZ eddd	Z	G d
d dee	 Z
dS )    )annotations)TYPE_CHECKING)Any)Generic)TypeVar)SeriesSeriesTzSeries[Any])boundc                   @  s    e Zd ZdddZdd	d
ZdS )SeriesStructNamespaceseriesr   returnNonec                 C  s
   || _ d S )N)_narwhals_series)selfr    r   J/var/www/vscode/kcb/lib/python3.10/site-packages/narwhals/series_struct.py__init__   s   
zSeriesStructNamespace.__init__namestrc                 C  s   | j | j jj|S )ae  Retrieve a Struct field as a new expression.

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

        Returns:
            A new Series.

        Examples:
            >>> import polars as pl
            >>> import narwhals as nw
            >>> s_native = pl.Series(
            ...     [
            ...         {"id": "0", "name": "john"},
            ...         {"id": "1", "name": "jane"},
            ...     ]
            ... )
            >>> s = nw.from_native(s_native, series_only=True)
            >>> s.struct.field("name").to_list()
            ['john', 'jane']
        )r   _with_compliant_compliant_seriesstructfield)r   r   r   r   r   r      s   zSeriesStructNamespace.fieldN)r   r   r   r   )r   r   r   r   )__name__
__module____qualname__r   r   r   r   r   r   r
      s    
r
   N)
__future__r   typingr   r   r   r   narwhals.seriesr   r   r
   r   r   r   r   <module>   s    