@@ -378,19 +378,19 @@ def _dict_to_grpc_vector(item):
378
378
sparse_values = None
379
379
if 'sparse_values' in item :
380
380
if not isinstance (item ['sparse_values' ], Mapping ):
381
- raise ValueError (f"Column `sparse_values` is expected to be a dictionary, found { type (item ['sparse_values' ])} " )
381
+ raise TypeError (f"Column `sparse_values` is expected to be a dictionary, found { type (item ['sparse_values' ])} " )
382
382
indices = item ['sparse_values' ].get ('indices' , None )
383
383
values = item ['sparse_values' ].get ('values' , None )
384
384
try :
385
385
sparse_values = GRPCSparseValues (indices = indices , values = values )
386
386
except TypeError as e :
387
- raise ValueError ("Found unexpected data in column `sparse_values`. "
387
+ raise TypeError ("Found unexpected data in column `sparse_values`. "
388
388
"Expected format is `'sparse_values': {'indices': List[int], 'values': List[float]}`."
389
389
) from e
390
390
391
- metadata = item .get ('metadata' , None )
392
- if metadata is not None and not isinstance (metadata , Mapping ):
393
- raise TypeError (f"Column `metadata` is expected to be a dictionary, found { type (metadata )} " )
391
+ metadata = item .get ('metadata' , None )
392
+ if metadata is not None and not isinstance (metadata , Mapping ):
393
+ raise TypeError (f"Column `metadata` is expected to be a dictionary, found { type (metadata )} " )
394
394
395
395
try :
396
396
return GRPCVector (id = item ['id' ], values = item ['values' ], sparse_values = sparse_values ,
0 commit comments