
    fI"                     V   d dl mZ ddlm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. d/e      Z G d0 d1e      Z G d2 d3e      Z G d4 d5e      Z G d6 d7      Zy8)9    )IntEnum   )
common_pb2c                   $    e Zd ZdZdZdZdZdZdZy)	ErrorCoder   r      	   d   i  N)	__name__
__module____qualname__SUCCESSUNEXPECTED_ERROR
RATE_LIMIT
FORCE_DENYCOLLECTION_NOT_FOUNDINDEX_NOT_FOUND     R/opt/lhia/ganansol/python/venv/lib/python3.12/site-packages/pymilvus/exceptions.pyr   r      s"    GJJOr   r   c            	            e Zd Zej                  dej                  fdedededdf fdZ	e
d        Ze
d	        Ze
d
        ZdefdZ xZS )MilvusException codemessagecompatible_codereturnNc                 L    t         |           || _        || _        || _        y N)super__init___code_message_compatible_code)selfr   r   r   	__class__s       r   r!   zMilvusException.__init__   s&     	
 /r   c                     | j                   S r   )r"   r%   s    r   r   zMilvusException.code(   s    zzr   c                     | j                   S r   )r#   r(   s    r   r   zMilvusException.message,   s    }}r   c                     | j                   S r   )r$   r(   s    r   r   zMilvusException.compatible_code0   s    $$$r   c                 h    dt        |       j                   d| j                   d| j                   dS )N<z: (code=z
, message=z)>)typer   r   r   r(   s    r   __str__zMilvusException.__str__4   s1    4:&&'x		{*T\\NRTUUr   )r   r   r   r   r   r   UnexpectedErrorintstrr!   propertyr   r   r   r.   __classcell__)r&   s   @r   r   r      s     ..)99	
0
0 
0 	
0
 

0     % %V Vr   r   c                       e Zd ZdZy)
ParamErrorzRaise when params are incorrectNr   r   r   __doc__r   r   r   r5   r5   8       )r   r5   c                       e Zd ZdZy)ConnectErrorzConnect server failNr6   r   r   r   r:   r:   <   s    r   r:   c                       e Zd ZdZy)MilvusUnavailableExceptionzRaise when server's UnavaliableNr6   r   r   r   r<   r<   @   r8   r   r<   c                       e Zd ZdZy)CollectionNotExistExceptionz$Raise when collections doesn't existNr6   r   r   r   r>   r>   D       .r   r>   c                       e Zd ZdZy)DescribeCollectionExceptionz&Raise when fail to describe collectionNr6   r   r   r   rA   rA   H   s    0r   rA   c                       e Zd ZdZy)PartitionAlreadyExistExceptionz'Raise when create an exsiting partitionNr6   r   r   r   rC   rC   L       1r   rC   c                       e Zd ZdZy)IndexNotExistExceptionzRaise when index doesn't existNr6   r   r   r   rF   rF   P   s    (r   rF   c                       e Zd ZdZy)AmbiguousIndexNamez3Raise multiple index exist, need specify index_nameNr6   r   r   r   rH   rH   T   s    =r   rH   c                       e Zd ZdZy)CannotInferSchemaExceptionz-Raise when cannot trasfer dataframe to schemaNr6   r   r   r   rJ   rJ   X   s    7r   rJ   c                       e Zd ZdZy)SchemaNotReadyExceptionzRaise when schema is wrongNr6   r   r   r   rL   rL   \   s    $r   rL   c                       e Zd ZdZy)DataTypeNotMatchExceptionz!Raise when datatype dosen't matchNr6   r   r   r   rN   rN   `       +r   rN   c                       e Zd ZdZy)DataTypeNotSupportExceptionz#Raise when datatype isn't supportedNr6   r   r   r   rQ   rQ   d       -r   rQ   c                       e Zd ZdZy)DataNotMatchExceptionz.Raise when insert data isn't match with schemaNr6   r   r   r   rT   rT   h   s    8r   rT   c                       e Zd ZdZy)ConnectionNotExistExceptionz$Raise when connections doesn't existNr6   r   r   r   rV   rV   l   r?   r   rV   c                       e Zd ZdZy)ConnectionConfigExceptionz,Raise when configs of connection are invalidNr6   r   r   r   rX   rX   p   s    6r   rX   c                       e Zd ZdZy)PrimaryKeyExceptionz!Raise when primarykey are invalidNr6   r   r   r   rZ   rZ   t   rO   r   rZ   c                       e Zd ZdZy)PartitionKeyExceptionz#Raise when partitionkey are invalidNr6   r   r   r   r\   r\   x   rR   r   r\   c                       e Zd ZdZy)ClusteringKeyExceptionz$Raise when clusteringkey are invalidNr6   r   r   r   r^   r^   |   r?   r   r^   c                       e Zd ZdZy)FieldsTypeExceptionzRaise when fields is invalidNr6   r   r   r   r`   r`          &r   r`   c                       e Zd ZdZy)FieldTypeExceptionzRaise when one field is invalidNr6   r   r   r   rc   rc      r8   r   rc   c                       e Zd ZdZy)AutoIDExceptionzRaise when autoID is invalidNr6   r   r   r   re   re      ra   r   re   c                       e Zd ZdZy)InvalidConsistencyLevelz'Raise when consistency level is invalidNr6   r   r   r   rg   rg      rD   r   rg   c                       e Zd ZdZy)UpsertAutoIDTrueExceptionz Raise when upsert autoID is trueNr6   r   r   r   ri   ri      s    *r   ri   c                      e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#Z%d$Z&d%Z'd&Z(d'Z)d(Z*d)Z+d*Z,d+Z-d,Z.d-Z/d.Z0d/Z1d0Z2d1Z3d2Z4d3Z5d4Z6d5Z7d6Z8d7Z9d8Z:d9Z;d:Z<d;Z=d<Z>d=Z?d>Z@d?ZAy@)AExceptionsMessagez8connection configuration must contain 'host' and 'port'.zType of 'host' must be str.z"Type of 'port' must be str or int.zYAlias of %r already creating connections, but the configure is not the same as passed in.z(Alias should be string, but %r is given.zBYou need to pass in the configuration of the connection named %r .zshould create connection first.zACollection %r not exist, or you can pass in schema to create one.z!Should be passed into the schema.z(The field of the schema cannot be empty.z,Schema type must be schema.CollectionSchema.zUThe collection already exist, but the schema is not the same as the schema passed in.z4Auto_id is True, primary field should not have data.z Param auto_id must be bool type.z&Param num_partitions must be int type.zXThe auto_id of the collection is inconsistent with the auto_id of the primary key field.z-The auto-generated id ranges should be pairs.zPThe parameter consistency_level is inconsistent with that of existed collection.z:The auto_id can only be specified on the primary key fieldzTThe auto_id can only be specified on field with DataType.INT64 and DataType.VARCHAR.z Must pass in at least one columnz0The data fields number is not match with schema.zNo vector field is found.zDataframe can not be None.z#Data type must be pandas.DataFrame.z%Schema must have a primary key field.z Primary field must in dataframe.z7Expected only one primary key field, got [%s, %s, ...].z9Expected only one partition key field, got [%s, %s, ...].z<Primary key type must be DataType.INT64 or DataType.VARCHAR.zDPartition key field type must be DataType.INT64 or DataType.VARCHAR.z/Partition key field should not be primary fieldz#Param is_primary must be bool type.z,Param primary_field must be int or str type.z+Param partition_key_field must be str type.z0the specified partition key field {%s} not existz)Param is_partition_key must be bool type.zIThe Input data type is inconsistent with defined schema, please check it.zData type is not support.zArrays must all be same length.z)Cannot infer schema from empty dataframe.z$Data type not support numpy.ndarray.z*The types of schema and data do not match.zPartition already exist.zIndex doesn't exist.z3The type of collection must be pymilvus.Collection.z'The fields of schema must be type list.z-The field of schema type must be FieldSchema.zField dtype must be of DataTypez1The type of expr must be string ,but %r is given.z?Environment variable %s has a wrong format, please check it: %sz:There are multiple indexes, please specify the index_name.zRAttempt to insert an unexpected field to collection without enabling dynamic fieldz#Upsert don't support autoid == truezIAmbiguous filter parameter, only one deletion condition can be specified.zSAmbiguous parameter, either ids or filter should be specified, cannot support both.zJSON key must be str.z0Clustering key field should not be primary fieldzClustering key field type must be DataType.INT8, DataType.INT16, DataType.INT32, DataType.INT64, DataType.FLOAT, DataType.DOUBLE, DataType.VARCHAR, DataType.FLOAT_VECTOR.z1the specified clustering key field {%s} not existz:Expected only one clustering key field, got [%s, %s, ...].z*Param is_clustering_key must be bool type.z,Param clustering_key_field must be str type.N)Br   r   r   
NoHostPortHostTypePortTypeConnDiffConf	AliasTypeConnLackConfConnectFirstCollectionNotExistNoSchemaNoSchemaEmptySchema
SchemaTypeSchemaInconsistentAutoIDWithData
AutoIDTypeNumPartitionsTypeAutoIDInconsistentAutoIDIllegalRangesConsistencyLevelInconsistentAutoIDOnlyOnPKAutoIDFieldTypeNumberRowsInvalidFieldsNumInconsistentNoVectorNoneDataFrameDataFrameTypeNoPrimaryKeyPrimaryKeyNotExistPrimaryKeyOnlyOnePartitionKeyOnlyOnePrimaryKeyTypePartitionKeyTypePartitionKeyNotPrimaryIsPrimaryTypePrimaryFieldTypePartitionKeyFieldTypePartitionKeyFieldNotExistIsPartitionKeyTypeDataTypeInconsistentDataTypeNotSupportDataLengthsInconsistentDataFrameInvalidNdArrayNotSupportTypeOfDataAndSchemaInconsistentPartitionAlreadyExistIndexNotExistCollectionType
FieldsType	FieldType
FieldDtypeExprTypeEnvConfigErrrH   InsertUnexpectedFieldUpsertAutoIDTrueAmbiguousDeleteFilterParamAmbiguousQueryFilterParamJSONKeyMustBeStrClusteringKeyNotPrimaryClusteringKeyTypeClusteringKeyFieldNotExistClusteringKeyOnlyOneIsClusteringKeyTypeClusteringKeyFieldTyper   r   r   rk   rk      s   KJ,H3H	:  ;IWL4L!d2H<K?J_  LN3J@	5  JZ ! RN^  ;N*H0M9M:L;QUSN]N9MEI RDS  5?B>&R#6*MJN:J?I2JBHTLU\  =S  	^  /P	3 
 "UWFKr   rk   N)enumr   grpc_genr   r   	Exceptionr   r5   r:   r<   r>   rA   rC   rF   rH   rJ   rL   rN   rQ   rT   rV   rX   rZ   r\   r^   r`   rc   re   rg   ri   rk   r   r   r   <module>r      sI      Vi V:* *? * *// /1/ 12_ 2)_ )> >8 8%o %, ,./ .9O 9// /7 7,/ ,.O ./_ /'/ '* *'o '2o 2+ +WL WLr   