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)Generic)TypeVar)ExprKind)ExprExprTr   )boundc                   @  s    e Zd Zd
ddZdddZd	S )ExprCatNamespaceexprr   returnNonec                 C  s
   || _ d S N)_expr)selfr    r   E/var/www/vscode/kcb/lib/python3.10/site-packages/narwhals/expr_cat.py__init__   s   
zExprCatNamespace.__init__c                   s"    j  fdd j jtjS )u  Get unique categories from column.

        Returns:
            A new expression.

        Examples:
            >>> import polars as pl
            >>> import narwhals as nw
            >>> df_native = pl.DataFrame(
            ...     {"fruits": ["apple", "mango", "mango"]},
            ...     schema={"fruits": pl.Categorical},
            ... )
            >>> df = nw.from_native(df_native)
            >>> df.select(nw.col("fruits").cat.get_categories()).to_native()
            shape: (2, 1)
            ┌────────┐
            │ fruits │
            │ ---    │
            │ str    │
            ╞════════╡
            │ apple  │
            │ mango  │
            └────────┘
        c                   s    j | j S r   )r   _to_compliant_exprcatget_categories)plxr   r   r   <lambda>-   s    z1ExprCatNamespace.get_categories.<locals>.<lambda>)r   	__class__	_metadata	with_kindr   
FILTRATIONr   r   r   r   r      s   
zExprCatNamespace.get_categoriesN)r   r   r   r   )r   r   )__name__
__module____qualname__r   r   r   r   r   r   r
      s    
r
   N)
__future__r   typingr   r   r   narwhals._expression_parsingr   narwhals.exprr   r   r
   r   r   r   r   <module>   s    