@@ -345,19 +345,19 @@ def _dict_to_grpc_vector(item):
345
345
sparse_values = None
346
346
if 'sparse_values' in item :
347
347
if not isinstance (item ['sparse_values' ], Mapping ):
348
- raise ValueError (f"Column `sparse_values` is expected to be a dictionary, found { type (item ['sparse_values' ])} " )
348
+ raise TypeError (f"Column `sparse_values` is expected to be a dictionary, found { type (item ['sparse_values' ])} " )
349
349
indices = item ['sparse_values' ].get ('indices' , None )
350
350
values = item ['sparse_values' ].get ('values' , None )
351
351
try :
352
352
sparse_values = GRPCSparseValues (indices = indices , values = values )
353
353
except TypeError as e :
354
- raise ValueError ("Found unexpected data in column `sparse_values`. "
354
+ raise TypeError ("Found unexpected data in column `sparse_values`. "
355
355
"Expected format is `'sparse_values': {'indices': List[int], 'values': List[float]}`."
356
356
) from e
357
357
358
- metadata = item .get ('metadata' , None )
359
- if metadata is not None and not isinstance (metadata , Mapping ):
360
- raise TypeError (f"Column `metadata` is expected to be a dictionary, found { type (metadata )} " )
358
+ metadata = item .get ('metadata' , None )
359
+ if metadata is not None and not isinstance (metadata , Mapping ):
360
+ raise TypeError (f"Column `metadata` is expected to be a dictionary, found { type (metadata )} " )
361
361
362
362
try :
363
363
return GRPCVector (id = item ['id' ], values = item ['values' ], sparse_values = sparse_values ,
0 commit comments