@@ -111,7 +111,7 @@ def online_write_batch(
111
111
for feature_name , val in values .items ():
112
112
vector_val = None
113
113
if config .online_store .vss_enabled :
114
- vector_val = get_list_val_str (val )
114
+ vector_val = self . _get_list_val_str (val )
115
115
conn .execute (
116
116
f"""
117
117
UPDATE { _table_id (project , table )}
@@ -281,6 +281,19 @@ def teardown(
281
281
except FileNotFoundError :
282
282
pass
283
283
284
+ def _get_list_val_str (self , val : ValueProto ) -> str :
285
+ if val .HasField ("string_list_val" ):
286
+ return "," .join (val .string_list_val .val )
287
+ elif val .HasField ("bytes_list_val" ):
288
+ return "," .join (map (str , val .bytes_list_val .val ))
289
+ elif val .HasField ("int64_list_val" ):
290
+ return "," .join (map (str , val .int64_list_val .val ))
291
+ elif val .HasField ("float_list_val" ):
292
+ return "," .join (map (str , val .float_list_val .val ))
293
+ elif val .HasField ("double_list_val" ):
294
+ return "," .join (map (str , val .double_list_val .val ))
295
+ else :
296
+ raise ValueError ("Unsupported list value type" )
284
297
285
298
def retrieve_online_documents (
286
299
self ,
@@ -360,7 +373,6 @@ def retrieve_online_documents(
360
373
return result
361
374
362
375
363
-
364
376
def _initialize_conn (db_path : str ):
365
377
Path (db_path ).parent .mkdir (exist_ok = True )
366
378
return sqlite3 .connect (
0 commit comments