
    hhf                    6    d dl mZ d dlmZ ddZdd
ZddZdS )    )annotations)warnreturnintc                 x   ddl } ddlm} ddl}t	           ||j                  j                  }|                                 }d}	 |rg|                     |          }|	                    |          s-t          |j        dd          x}r"|	                    d          r|j        }|dz  }nn|g	 ~n# ~w xY w|S )zFind the first place in the stack that is not inside narwhals.

    Taken from:
    https://github.com/pandas-dev/pandas/blob/ab89c53f48df67709a533b6a95ce3d911871a0a8/pandas/util/_exceptions.py#L30-L51
    r   N)Pathco_qualnamezsingledispatch.   )inspectpathlibr   narwhalsstr__file__parentcurrentframegetfile
startswithgetattrf_codef_back)r   r   nwpkg_dirframenfnamequalnames           K/var/www/histauto/venv/lib/python3.11/site-packages/narwhals/_exceptions.pyfind_stacklevelr      s    NNN$$r{##*++G   ""E	A 	OOE**E(( $U\=$GGG ''(9::
 Q  	  EE				Hs   A*B4 4B7messager   _versionNonec                L    t          | t          t                                 dS )zIssue a deprecation warning.

    Arguments:
        message: The message associated with the warning.
        _version: Narwhals version when the warning was introduced. Just used for internal
            bookkeeping.
    r   category
stacklevelN)r   DeprecationWarningr   )r   r    s     r   issue_deprecation_warningr'   -   s&     	#5/BSBSTTTTTT    r$   type[Warning]c                B    t          | |t                                 d S )Nr#   )r   r   )r   r$   s     r   issue_warningr+   8   s#    88I8IJJJJJJr(   N)r   r   )r   r   r    r   r   r!   )r   r   r$   r)   r   r!   )
__future__r   warningsr   r   r'   r+    r(   r   <module>r/      sz    " " " " " "      $ $ $ $NU U U UK K K K K Kr(   