o
    it                     @  s   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rDd dlmZ d dlmZ d d	l	mZ ed
ZedZddddZdddZdS )    )annotationsN)wraps)TYPE_CHECKINGTypeVar)issue_warning)UnstableWarning)Callable)	ParamSpec)IdentityFunctionPTmessage
str | NonereturnNonec                 C  s@   t ttjdd}|sdS | du rd} | d7 } t| t dS )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
    Z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   )r   Zwarnings_enabled r   M/home/app/Keep/.python/lib/python3.10/site-packages/polars/_utils/unstable.pyissue_unstable_warning   s   r   r
   c                  C  s   ddd} | S )z)Decorator to mark a function as unstable.functionCallable[P, T]r   c                   s&   t  d	 fdd}t |_|S )
NargsP.argskwargsP.kwargsr   r   c                    s    t d j d  | i |S )N`z` is considered unstable.)r   __name__)r   r   r   r   r   wrapper5   s   z+unstable.<locals>.decorate.<locals>.wrapper)r   r   r   r   r   r   )r   inspect	signature__signature__)r   r"   r   r!   r   decorate4   s   zunstable.<locals>.decorateN)r   r   r   r   r   )r&   r   r   r   unstable1   s   
	r'   )N)r   r   r   r   )r   r
   )
__future__r   r#   r   	functoolsr   typingr   r   Zpolars._utils.variousr   Zpolars.exceptionsr   collections.abcr   r	   r
   r   r   r   r'   r   r   r   r   <module>   s    