
    ɯeim                     \   d Z ddlZddlmZ ddlmZ  ej                  e      Z	 G d de
      Z G d de      Z G d	 d
e      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d d e      Z G d! d"e      Z G d# d$e      Z G d% d&e      Z G d' d(e      Z G d) d*e      Z G d+ d,e      Z G d- d.e      Z G d/ d0e      Z  G d1 d2e       Z! G d3 d4e      Z"y)5z:This package contains all Snowpark client-side exceptions.    N)Optional)Errorc                   B    e Zd ZdZdddedee   ddfdZd Zd	 Zd
 Z	y)SnowparkClientExceptionzBase Snowpark exception classN
error_codemessager   returnc                    || _         || _        || _        | j                  r"d| j                   d| j                    | _        y | j                   | _        y )N(): )r	   r   telemetry_message_pretty_msg)selfr	   r   s      _/var/www/html/glpi_dashboard/venv/lib/python3.12/site-packages/snowflake/snowpark/exceptions.py__init__z SnowparkClientException.__init__   sR     $)3&- 7;ooa DLL>2 	KO<< 	    c                 h    | j                   j                   d| j                  d| j                  dS Nr   z, ))	__class____name__r	   r   r   s    r   __repr__z SnowparkClientException.__repr__    s1    ..))*!DLL+;2doo=PPQRRr   c                     | j                   S )N)r   r   s    r   __str__zSnowparkClientException.__str__#   s    r   c                 N    | j                   | j                  fd| j                  ifS )Nr   )r   r	   r   r   s    r   
__reduce__z"SnowparkClientException.__reduce__&   s"    ,1PQQr   )
r   
__module____qualname____doc__strr   r   r   r   r    r   r   r   r      s@    ' %)	

 SM	

 

S Rr   r   c                       e Zd ZdZy)_SnowparkInternalExceptionzsException for internal errors. For internal use only.

    Includes all error codes in 10XX (where XX is 0-9).
    Nr   r   r    r!   r#   r   r   r%   r%   *       
 	r   r%   c                       e Zd ZdZy)SnowparkDataframeExceptionzException for dataframe related errors.

    Includes all error codes in range 11XX (where XX is 0-9).

    This exception is specifically raised for error codes: 1104, 1107, 1108, 1109.
    Nr&   r#   r   r   r)   r)   3        	r   r)   c                       e Zd ZdZy)SnowparkPlanExceptionzException for plan analysis errors.

    Includes all error codes in range 12XX (where XX is 0-9).

    This exception is specifically raised for error codes: 1200, 1201, 1202, 1205.
    Nr&   r#   r   r   r,   r,   >   r*   r   r,   c                        e Zd ZdZdddddddddedee   dee   dee   dee   d	ee   d
ee   dee   ddf fdZd Z	 xZ
S )SnowparkSQLExceptionzException for errors related to the executed SQL statement that was generated
    from the Snowflake plan.

    Includes all error codes in range 13XX (where XX is 0-9).

    This exception is specifically raised for error codes: 1300, 1304.
    N)r   
conn_errorsfqidquerysql_error_coderaw_messagedebug_contextr	   r   r/   r0   r1   r2   r3   r4   r
   c                   t         |   ||       || _        |xs t        | j                  dd       | _        |xs t        | j                  dd       | _        |xs t        | j                  dd       | _        |xs t        | j                  dd       | _        || _        | j                  rd| j                   dnd}	| j                  r| j                   d	nd}
|	 |
 | j                   | j                  xs d | _        y )
Nr   r0   r1   errnoraw_msgr   r    z: )superr   r/   getattrr0   r1   r2   r3   r4   r   r	   r   )r   r	   r   r/   r0   r1   r2   r3   r4   pretty_error_codepretty_sfqidr   s              r   r   zSnowparkSQLException.__init__R   s     	Z8$EgdoowE
EgdoowE
,WRV0W&S'$//9d*S*8<a04R,0JJ$**R(B !,~d>P>P>VTV=WX 	r   c                     | j                   j                   d| j                  d| j                  d| j                  dS r   )r   r   r	   r   r0   r   s    r   r   zSnowparkSQLException.__repr__m   s@    ..))*!DLL+;2doo=PPRSWS]S]R``abbr   )r   r   r    r!   r"   r   ConnectorErrorintr   r   __classcell__)r   s   @r   r.   r.   I   s     %)/3##(,%)'+

 SM	

 ^,
 }
 }
 !
 c]
  }
 

6cr   r.   c                       e Zd ZdZy)SnowparkServerExceptionzoException for miscellaneous related errors.

    Includes all error codes in range 14XX (where XX is 0-9).
    Nr&   r#   r   r   rB   rB   q   r'   r   rB   c                       e Zd ZdZy)SnowparkGeneralExceptionzeException for general exceptions.

    Includes all error codes in range 15XX (where XX is 0-9).
    Nr&   r#   r   r   rD   rD   z   r'   r   rD   c                       e Zd ZdZy)SnowparkColumnExceptionzxException for column related errors during dataframe operations.

    Includes error codes: 1100, 1101, 1102, 1105.
    Nr&   r#   r   r   rF   rF      r'   r   rF   c                       e Zd ZdZy)SnowparkJoinExceptionzvException for join related errors during dataframe operations.

    Includes error codes: 1103, 1110, 1111, 1112.
    Nr&   r#   r   r   rH   rH      r'   r   rH   c                       e Zd ZdZy) SnowparkDataframeReaderExceptionzLException for dataframe reader errors.

    Includes error codes: 1106.
    Nr&   r#   r   r   rJ   rJ      r'   r   rJ   c                       e Zd ZdZy)SnowparkPandasExceptionzJException for pandas related errors.

    Includes error codes: 1106.
    Nr&   r#   r   r   rL   rL      r'   r   rL   c                       e Zd ZdZy)SnowparkTableExceptionzIException for table related errors.

    Includes error codes: 1115.
    Nr&   r#   r   r   rN   rN      r'   r   rN   c                       e Zd ZdZy)SnowparkCreateViewExceptionzkException for errors while trying to create a view.

    Includes error codes: 1203, 1204, 1205, 1206.
    Nr&   r#   r   r   rP   rP      r'   r   rP   c                       e Zd ZdZy)#SnowparkCreateDynamicTableExceptionzhException for errors while trying to create a dynamic table.

    Includes error codes: 1207, 1208.
    Nr&   r#   r   r   rR   rR      r'   r   rR   c                       e Zd ZdZy)!SnowparkSQLAmbiguousJoinExceptionz{Exception for ambiguous joins that are created from the
    translated SQL statement.

    Includes error codes: 1303.
    Nr&   r#   r   r   rT   rT           	r   rT   c                       e Zd ZdZy)SnowparkSQLInvalidIdExceptionzException for having an invalid ID (usually a missing ID)
    that are created from the translated SQL statement.

    Includes error codes: 1302.
    Nr&   r#   r   r   rW   rW      rU   r   rW   c                       e Zd ZdZy)#SnowparkSQLUnexpectedAliasExceptionzException for having an unexpected alias that are created
    from the translated SQL statement.

    Includes error codes: 1301.
    Nr&   r#   r   r   rY   rY      rU   r   rY   c                       e Zd ZdZy)SnowparkSessionExceptionzaException for any session related errors.

    Includes error codes: 1402, 1403, 1404, 1405.
    Nr&   r#   r   r   r[   r[      r'   r   r[   c                       e Zd ZdZy)"SnowparkMissingDbOrSchemaExceptionzException for when a schema or database is missing in the session connection.
    These are needed to run queries.

    Includes error codes: 1400.
    Nr&   r#   r   r   r]   r]      rU   r   r]   c                       e Zd ZdZy)SnowparkQueryCancelledExceptionzjException for when we are trying to interact with a cancelled query.

    Includes error codes: 1401.
    Nr&   r#   r   r   r_   r_      r'   r   r_   c                       e Zd ZdZy)SnowparkFetchDataExceptionzdException for when we are trying to fetch data from Snowflake.

    Includes error codes: 1406.
    Nr&   r#   r   r   ra   ra      r'   r   ra   c                       e Zd ZdZy)SnowparkUploadFileExceptionzeException for when we are trying to upload files to the server.

    Includes error codes: 1408.
    Nr&   r#   r   r   rc   rc     r'   r   rc   c                       e Zd ZdZy)SnowparkUploadUdfFileExceptionziException for when we are trying to upload UDF files to the server.

    Includes error codes: 1407.
    Nr&   r#   r   r   re   re     r'   r   re   c                       e Zd ZdZy)"SnowparkInvalidObjectNameExceptionzException for inputting an invalid object name. Checked locally.

    This exception is specifically raised for error codes: 1500.
    Nr&   r#   r   r   rg   rg     r'   r   rg   )#r!   loggingtypingr   snowflake.connector.errorsr   r>   	getLoggerr   _logger	Exceptionr   r%   r)   r,   r.   rB   rD   rF   rH   rJ   rL   rN   rP   rR   rT   rW   rY   r[   r]   r_   ra   rc   re   rg   r#   r   r   <module>rn      sb   A   >
'

H
%Ri R6	!8 		!8 		3 	%c2 %cP	5 		6 		8 		6 		'A 		8 		7 		"7 		*? 		(< 		$8 		*> 		6 		)@ 		&= 		!8 		"9 		%@ 		)A 	r   