
    AHjo                        d dl mZ d dlZd dlZd dlmZ d dlmZ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d
      Z ed      ZdddZddZy)    )annotationsN)wraps)TYPE_CHECKINGTypeVar)issue_warning)UnstableWarning)Callable)	ParamSpec)IdentityFunctionPTc                    t        t        t        j                  j	                  dd                  }|sy| d} | dz  } t        | t               y)a  
    Issue a warning for use of unstable functionality.

    The `warn_unstable` setting must be enabled, otherwise no warning is issued.

    Parameters
    ----------
    message
        The message associated with the warning.

    See Also
    --------
    Config.warn_unstable
    POLARS_WARN_UNSTABLEr   Nz*this functionality is considered unstable.zN It may be changed at any point without it being considered a breaking change.)boolintosenvirongetr   r   )messagewarnings_enableds     N/root/tools/cai/cai_env/lib/python3.12/site-packages/polars/_utils/unstable.pyissue_unstable_warningr      sM     C

/Eq IJK>XG '?+    c                     dd} | S )z)Decorator to mark a function as unstable.c                d     t               d fd       }t        j                         |_        |S )Nc                 F    t        dj                   d        | i |S )N`z` is considered unstable.)r   __name__)argskwargsfunctions     r   wrapperz+unstable.<locals>.decorate.<locals>.wrapper5   s,    "Qx'8'8&99R#STT,V,,r   )r   zP.argsr    zP.kwargsreturnr   )r   inspect	signature__signature__)r!   r"   s   ` r   decoratezunstable.<locals>.decorate4   s3    	x	- 
	- !( 1 1( ;r   )r!   Callable[P, T]r#   r(    )r'   s    r   unstabler*   1   s     Or   )N)r   z
str | Noner#   None)r#   r   )
__future__r   r$   r   	functoolsr   typingr   r   polars._warningsr   polars.exceptionsr   collections.abcr	   r
   polars._utils.variousr   r   r   r   r*   r)   r   r   <module>r3      sB    "  	  ) * -( 6#AA,8r   