
    Lpj                    F   S SK Jr  S SKJr  \(       a  S SKJrJr   " S S\5      r " S S\	5      r
 " S S	\
\5      r " S
 S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\\5      r " S S\5      r " S S\5      r " S S\5      rg)    )annotations)TYPE_CHECKING)
CollectionIterablec                      \ rS rSrSrSrg)NarwhalsError	   z'Base class for all Narwhals exceptions. N__name__
__module____qualname____firstlineno____doc____static_attributes__r
       O/var/www/html/pdf-tiff/venv/lib/python3.13/site-packages/narwhals/exceptions.pyr   r   	   s    1r   r   c                  8    \ rS rSr% SrS\S'   S	S jrS
S jrSrg)FormattedKeyError   a#  KeyError with formatted error message.

Python's `KeyError` has special casing around formatting
(see https://bugs.python.org/issue2651). Use this class when the error
message has newlines and other special format characters.
Needed by https://github.com/tensorflow/tensorflow/issues/36857.
strmessagec                    Xl         g Nr   )selfr   s     r   __init__FormattedKeyError.__init__   s    r   c                    U R                   $ r   r   )r   s    r   __str__FormattedKeyError.__str__   s    ||r   r   Nr   r   returnNone)r#   r   )	r   r   r   r   r   __annotations__r   r    r   r
   r   r   r   r      s     Lr   r   c                  x   ^  \ rS rSr% SrS\S'   S	U 4S jjr\      S
S j5       r\    SS j5       r	Sr
U =r$ )ColumnNotFoundError   z0Exception raised when column name isn't present.r   r   c                D   > Xl         [        TU ]	  U R                   5        g r   r   superr   r   r   	__class__s     r   r   ColumnNotFoundError.__init__$       &r   c               N    S[        U5       S[        U5       S3n[        U5      $ )Nz&The following columns were not found: z+

Hint: Did you mean one of these columns: ?)sortedlistr'   )clsmissing_columnsavailable_columnsr   s       r   'from_missing_and_available_column_names;ColumnNotFoundError.from_missing_and_available_column_names(   s:    
 5VO5L4M;DAR<S;TTUW 	 #7++r   c                6    S[        U5       S3n[        U5      $ )NzOThe selected columns were not found.

Hint: Did you mean one of these columns: r1   )r3   r'   )r4   r6   r   s      r   from_available_column_names/ColumnNotFoundError.from_available_column_names2   s.    
<<@AR<S;TTUW 	 #7++r   r   r"   )r5   zIterable[str]r6   Collection[str]r#   r'   )r6   r<   r#   r'   )r   r   r   r   r   r%   r   classmethodr7   r:   r   __classcell__r-   s   @r   r'   r'      s`    :L' ,+,@O,	, , , /,	, ,r   r'   c                      \ rS rSrSrSrg)ComputeError=   zHException raised when the underlying computation could not be evaluated.r
   Nr   r
   r   r   rA   rA   =   s    Rr   rA   c                      \ rS rSrSrSrg)
ShapeErrorA   z_Exception raised when trying to perform operations on data structures with incompatible shapes.r
   Nr   r
   r   r   rD   rD   A       ir   rD   c                      \ rS rSrSrSrg)MultiOutputExpressionErrorE   zKException raised when using multi-output expression in unsupported context.r
   Nr   r
   r   r   rH   rH   E   s    Ur   rH   c                      \ rS rSrSrSrg)DuplicateErrorI   z6Exception when duplicate column names are encountered.r
   Nr   r
   r   r   rK   rK   I   s    @r   rK   c                      \ rS rSrSrSrg)InvalidOperationErrorM   z+Exception raised during invalid operations.r
   Nr   r
   r   r   rN   rN   M   s    5r   rN   c                  P   ^  \ rS rSr% SrS\S'   SU 4S jjr\S	S j5       rSr	U =r
$ )
InvalidIntoExprErrorQ   z>Exception raised when object can't be converted to expression.r   r   c                D   > Xl         [        TU ]	  U R                   5        g r   r*   r,   s     r   r   InvalidIntoExprError.__init__V   r/   r   c                $    SU S3n[        U5      $ )NzBExpected an object which can be converted into an expression, got a  

Hint:
- if you were trying to select a column which does not have a string
  column name, then you should explicitly use `nw.col`.
  For example, `df.select(nw.col(0))` if you have a column named `0`.
- if you were trying to create a new literal column, then you 
  should explicitly use `nw.lit`.
  For example, `df.select(nw.lit(0))` if you want to create a new
  column with literal value `0`.)rQ   )r4   invalid_typer   s      r   from_invalid_type&InvalidIntoExprError.from_invalid_typeZ   s+     QQ]P^ _/ / 	 $G,,r   r   r"   )r4   typerV   rY   r#   rQ   )r   r   r   r   r   r%   r   r=   rW   r   r>   r?   s   @r   rQ   rQ   Q   s$    HL' - -r   rQ   c                      \ rS rSrSrSrg)UnsupportedDTypeErrorj   z_Exception raised when trying to convert to a DType which is not supported by the given backend.r
   Nr   r
   r   r   r[   r[   j   rF   r   r[   c                      \ rS rSrSrSrg)NarwhalsUnstableWarningn   zRWarning issued when a method or function is considered unstable in the stable api.r
   Nr   r
   r   r   r^   r^   n   s    \r   r^   c                      \ rS rSrSrg)PerformanceWarningr   r
   N)r   r   r   r   r   r
   r   r   ra   ra   r   s    3r   ra   N)
__future__r   typingr   collections.abcr   r   
ValueErrorr   KeyErrorr   r'   rA   rD   rH   rK   rN   	TypeErrorrQ   r[   UserWarningr^   Warningra   r
   r   r   <module>rk      s    "  42J 2 $,+] ,<S= Sj jV VA] A6M 6-9m -2jM j]k ] ' &r   