
    AHj                        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
 d dlmZ erd dlmZ d dlmZ d d	lmZ e G d
 d             Zy)    )annotations)TYPE_CHECKING)	datatypes)unstable)wrap_s)expr_dispatch)Series)PySeries)PolarsDataTypec                  T    e Zd ZdZdZddZ e       dd       Z e       d	d       Zy)
ExtensionNameSpacezSeries.ext namespace.extc                &    |j                   | _         y )N)_s)selfseriess     I/root/tools/cai/cai_env/lib/python3.12/site-packages/polars/series/ext.py__init__zExtensionNameSpace.__init__   s    "II    c                    t        |t        j                        sJ t        | j                  j                  |            S )a>  
        Create a Series with an extension `dtype`.

        The input series must have the storage type of the extension dtype.

        .. warning::
            This functionality is currently considered **unstable**. It may be
            changed at any point without it being considered a breaking change.
        )
isinstancedtBaseExtensionr   r   ext_to)r   dtypes     r   tozExtensionNameSpace.to   s2     %!1!1222dggnnU+,,r   c                H    t        | j                  j                               S )a_  
        Get the storage values of a Series with an extension data type.

        If the input series does not have an extension data type, it is returned as-is.

        .. warning::
            This functionality is currently considered **unstable**. It may be
            changed at any point without it being considered a breaking change.
        )r   r   ext_storage)r   s    r   storagezExtensionNameSpace.storage)   s     dgg))+,,r   N)r   r	   returnNone)r   r   r    r	   )r    r	   )	__name__
__module____qualname____doc__	_accessorr   r   r   r    r   r   r   r      s;    I& Z- - Z
- 
-r   r   N)
__future__r   typingr   polarsr   r   polars._utils.unstabler   polars._utils.wrapr   polars.series.utilsr   r	   polars._plrr
   polars._typingr   r   r'   r   r   <module>r0      s>    "   " + % -$
 !- !- !-r   