Skip to content

Commit 8e9dcb2

Browse files
updated function
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
1 parent 02e9881 commit 8e9dcb2

File tree

1 file changed

+14
-2
lines changed
  • sdk/python/feast/infra/online_stores

1 file changed

+14
-2
lines changed

sdk/python/feast/infra/online_stores/sqlite.py

+14-2
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def online_write_batch(
111111
for feature_name, val in values.items():
112112
vector_val = None
113113
if config.online_store.vss_enabled:
114-
vector_val = get_list_val_str(val)
114+
vector_val = self._get_list_val_str(val)
115115
conn.execute(
116116
f"""
117117
UPDATE {_table_id(project, table)}
@@ -281,6 +281,19 @@ def teardown(
281281
except FileNotFoundError:
282282
pass
283283

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")
284297

285298
def retrieve_online_documents(
286299
self,
@@ -360,7 +373,6 @@ def retrieve_online_documents(
360373
return result
361374

362375

363-
364376
def _initialize_conn(db_path: str):
365377
Path(db_path).parent.mkdir(exist_ok=True)
366378
return sqlite3.connect(

0 commit comments

Comments
 (0)