pinecone.data.errors
1from ..utils.constants import REQUIRED_VECTOR_FIELDS, OPTIONAL_VECTOR_FIELDS 2 3 4class VectorDictionaryMissingKeysError(ValueError): 5 def __init__(self, item): 6 message = f"Vector dictionary is missing required fields: {list(REQUIRED_VECTOR_FIELDS - set(item.keys()))}" 7 super().__init__(message) 8 9 10class VectorDictionaryExcessKeysError(ValueError): 11 def __init__(self, item): 12 invalid_keys = list(set(item.keys()) - (REQUIRED_VECTOR_FIELDS | OPTIONAL_VECTOR_FIELDS)) 13 message = f"Found excess keys in the vector dictionary: {invalid_keys}. The allowed keys are: {list(REQUIRED_VECTOR_FIELDS | OPTIONAL_VECTOR_FIELDS)}" 14 super().__init__(message) 15 16 17class VectorTupleLengthError(ValueError): 18 def __init__(self, item): 19 message = f"Found a tuple of length {len(item)} which is not supported. Vectors can be represented as tuples either the form (id, values, metadata) or (id, values). To pass sparse values please use either dicts or Vector objects as inputs." 20 super().__init__(message) 21 22 23class SparseValuesTypeError(ValueError, TypeError): 24 def __init__(self): 25 message = "Found unexpected data in column `sparse_values`. Expected format is `'sparse_values': {'indices': List[int], 'values': List[float]}`." 26 super().__init__(message) 27 28 29class SparseValuesMissingKeysError(ValueError): 30 def __init__(self, sparse_values_dict): 31 message = f"Missing required keys in data in column `sparse_values`. Expected format is `'sparse_values': {{'indices': List[int], 'values': List[float]}}`. Found keys {list(sparse_values_dict.keys())}" 32 super().__init__(message) 33 34 35class SparseValuesDictionaryExpectedError(ValueError, TypeError): 36 def __init__(self, sparse_values_dict): 37 message = f"Column `sparse_values` is expected to be a dictionary, found {type(sparse_values_dict)}" 38 super().__init__(message) 39 40 41class MetadataDictionaryExpectedError(ValueError, TypeError): 42 def __init__(self, item): 43 message = ( 44 f"Column `metadata` is expected to be a dictionary, found {type(item['metadata'])}" 45 ) 46 super().__init__(message)
class
VectorDictionaryMissingKeysError(builtins.ValueError):
5class VectorDictionaryMissingKeysError(ValueError): 6 def __init__(self, item): 7 message = f"Vector dictionary is missing required fields: {list(REQUIRED_VECTOR_FIELDS - set(item.keys()))}" 8 super().__init__(message)
Inappropriate argument value (of correct type).
Inherited Members
- builtins.BaseException
- with_traceback
- add_note
- args
class
VectorDictionaryExcessKeysError(builtins.ValueError):
11class VectorDictionaryExcessKeysError(ValueError): 12 def __init__(self, item): 13 invalid_keys = list(set(item.keys()) - (REQUIRED_VECTOR_FIELDS | OPTIONAL_VECTOR_FIELDS)) 14 message = f"Found excess keys in the vector dictionary: {invalid_keys}. The allowed keys are: {list(REQUIRED_VECTOR_FIELDS | OPTIONAL_VECTOR_FIELDS)}" 15 super().__init__(message)
Inappropriate argument value (of correct type).
VectorDictionaryExcessKeysError(item)
12 def __init__(self, item): 13 invalid_keys = list(set(item.keys()) - (REQUIRED_VECTOR_FIELDS | OPTIONAL_VECTOR_FIELDS)) 14 message = f"Found excess keys in the vector dictionary: {invalid_keys}. The allowed keys are: {list(REQUIRED_VECTOR_FIELDS | OPTIONAL_VECTOR_FIELDS)}" 15 super().__init__(message)
Inherited Members
- builtins.BaseException
- with_traceback
- add_note
- args
class
VectorTupleLengthError(builtins.ValueError):
18class VectorTupleLengthError(ValueError): 19 def __init__(self, item): 20 message = f"Found a tuple of length {len(item)} which is not supported. Vectors can be represented as tuples either the form (id, values, metadata) or (id, values). To pass sparse values please use either dicts or Vector objects as inputs." 21 super().__init__(message)
Inappropriate argument value (of correct type).
VectorTupleLengthError(item)
19 def __init__(self, item): 20 message = f"Found a tuple of length {len(item)} which is not supported. Vectors can be represented as tuples either the form (id, values, metadata) or (id, values). To pass sparse values please use either dicts or Vector objects as inputs." 21 super().__init__(message)
Inherited Members
- builtins.BaseException
- with_traceback
- add_note
- args
class
SparseValuesTypeError(builtins.ValueError, builtins.TypeError):
24class SparseValuesTypeError(ValueError, TypeError): 25 def __init__(self): 26 message = "Found unexpected data in column `sparse_values`. Expected format is `'sparse_values': {'indices': List[int], 'values': List[float]}`." 27 super().__init__(message)
Inappropriate argument value (of correct type).
Inherited Members
- builtins.BaseException
- with_traceback
- add_note
- args
class
SparseValuesMissingKeysError(builtins.ValueError):
30class SparseValuesMissingKeysError(ValueError): 31 def __init__(self, sparse_values_dict): 32 message = f"Missing required keys in data in column `sparse_values`. Expected format is `'sparse_values': {{'indices': List[int], 'values': List[float]}}`. Found keys {list(sparse_values_dict.keys())}" 33 super().__init__(message)
Inappropriate argument value (of correct type).
Inherited Members
- builtins.BaseException
- with_traceback
- add_note
- args
class
SparseValuesDictionaryExpectedError(builtins.ValueError, builtins.TypeError):
36class SparseValuesDictionaryExpectedError(ValueError, TypeError): 37 def __init__(self, sparse_values_dict): 38 message = f"Column `sparse_values` is expected to be a dictionary, found {type(sparse_values_dict)}" 39 super().__init__(message)
Inappropriate argument value (of correct type).
Inherited Members
- builtins.BaseException
- with_traceback
- add_note
- args
class
MetadataDictionaryExpectedError(builtins.ValueError, builtins.TypeError):
42class MetadataDictionaryExpectedError(ValueError, TypeError): 43 def __init__(self, item): 44 message = ( 45 f"Column `metadata` is expected to be a dictionary, found {type(item['metadata'])}" 46 ) 47 super().__init__(message)
Inappropriate argument value (of correct type).
Inherited Members
- builtins.BaseException
- with_traceback
- add_note
- args