
    h                    H   S SK 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 " S S\5      r " S S\5      rg)    )annotationsc                      \ 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       E/var/www/html/env/lib/python3.13/site-packages/narwhals/exceptions.pyr   r      s    1r   r   c                  ,    \ rS rSrSr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.
c                    Xl         g Nmessage)selfr   s     r   __init__FormattedKeyError.__init__   s    r   c                    U R                   $ r   r   )r   s    r   __str__FormattedKeyError.__str__   s    ||r   r   Nr   strreturnNone)r    r   )r	   r
   r   r   r   r   r   r   r   r   r   r   r      s    r   r   c                  T   ^  \ rS rSrSrSU 4S jjr\        SS j5       rSrU =r	$ )ColumnNotFoundError   z0Exception raised when column name isn't present.c                D   > Xl         [        TU ]	  U R                   5        g r   r   superr   r   r   	__class__s     r   r   ColumnNotFoundError.__init__       &r   c                *    SU SU S3n[        U5      $ )Nz&The following columns were not found: z+

Hint: Did you mean one of these columns: ?)r#   )clsmissing_columnsavailable_columnsr   s       r   'from_missing_and_available_column_names;ColumnNotFoundError.from_missing_and_available_column_names   s/    
 5_4E;<M;NaQ 	 #7++r   r   r   )r.   typer/   	list[str]r0   r4   r    r#   )
r	   r
   r   r   r   r   classmethodr1   r   __classcell__r)   s   @r   r#   r#      s?    :' ,,$-,BK,	, ,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   r9   r9   *   s    Rr   r9   c                      \ rS rSrSrSrg)
ShapeError.   z_Exception raised when trying to perform operations on data structures with incompatible shapes.r   Nr   r   r   r   r<   r<   .       ir   r<   c                      \ rS rSrSrSrg)MultiOutputExpressionError2   zKException raised when using multi-output expression in unsupported context.r   Nr   r   r   r   r@   r@   2   s    Ur   r@   c                      \ rS rSrSrSrg)DuplicateError6   z6Exception when duplicate column names are encountered.r   Nr   r   r   r   rC   rC   6   s    @r   rC   c                      \ rS rSrSrSrg)InvalidOperationError:   z+Exception raised during invalid operations.r   Nr   r   r   r   rF   rF   :   s    5r   rF   c                  D   ^  \ rS rSrSrSU 4S jjr\SS j5       rSrU =r	$ )InvalidIntoExprError>   z>Exception raised when object can't be converted to expression.c                D   > Xl         [        TU ]	  U R                   5        g r   r&   r(   s     r   r   InvalidIntoExprError.__init__A   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`.)rI   )r.   invalid_typer   s      r   from_invalid_type&InvalidIntoExprError.from_invalid_typeE   s+     QQ]P^ _/ / 	 $G,,r   r   r   )r.   r3   rN   r3   r    rI   )
r	   r
   r   r   r   r   r5   rO   r   r6   r7   s   @r   rI   rI   >   s    H' - -r   rI   c                  D   ^  \ rS rSrSrSU 4S jjr\SS j5       rSrU =r	$ )AnonymousExprErrorU   zLException raised when trying to perform operations on anonymous expressions.c                D   > Xl         [        TU ]	  U R                   5        g r   r&   r(   s     r   r   AnonymousExprError.__init__X   r+   r   c                $    SU S3n[        U5      $ )Nz,Anonymous expressions are not supported in `zR`.
Instead of `nw.all()`, try using a named expression, such as `nw.col('a', 'b')`)rR   )r.   	expr_namer   s      r   from_expr_name!AnonymousExprError.from_expr_name\   s(     ;9+ F! ! 	
 "'**r   r   r   )r.   r3   rW   r   r    rR   )
r	   r
   r   r   r   r   r5   rX   r   r6   r7   s   @r   rR   rR   U   s    V' + +r   rR   c                  0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )OrderDependentExprErrorf   zSException raised when trying to use an order-dependent expressions with LazyFrames.c                D   > Xl         [        TU ]	  U R                   5        g r   r&   r(   s     r   r    OrderDependentExprError.__init__i   r+   r   r   r   r	   r
   r   r   r   r   r   r6   r7   s   @r   r[   r[   f   s    ]' 'r   r[   c                  0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )LengthChangingExprErrorn   zWException raised when trying to use an expression which changes length with LazyFrames.c                D   > Xl         [        TU ]	  U R                   5        g r   r&   r(   s     r   r    LengthChangingExprError.__init__q   r+   r   r   r   r_   r7   s   @r   ra   ra   n   s    a' 'r   ra   c                      \ rS rSrSrSrg)UnsupportedDTypeErrorv   z_Exception raised when trying to convert to a DType which is not supported by the given backend.r   Nr   r   r   r   rf   rf   v   r>   r   rf   c                      \ rS rSrSrSrg)NarwhalsUnstableWarningz   zRWarning issued when a method or function is considered unstable in the stable api.r   Nr   r   r   r   ri   ri   z   s    \r   ri   N)
__future__r   
ValueErrorr   KeyErrorr   r#   r9   r<   r@   rC   rF   	TypeErrorrI   rR   r[   ra   rf   UserWarningri   r   r   r   <module>rp      s    "2J 2  ,+] ,$S= Sj jV VA] A6M 6-9m -.+ +"'m ''m 'jM j]k ]r   