Skip to content

Commit 0d0d117

Browse files
checking in progress
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
1 parent 22bf637 commit 0d0d117

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

  • sdk/python/feast/infra/online_stores

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

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from pathlib import Path
2222
from typing import Any, Callable, Dict, List, Literal, Optional, Sequence, Tuple, Union
2323

24+
import pandas as pd
2425
from google.protobuf.internal.containers import RepeatedScalarFieldContainer
2526
from pydantic import StrictStr
2627

@@ -153,13 +154,6 @@ def online_write_batch(
153154
)
154155

155156
else:
156-
if (
157-
table_name
158-
== "test_on_demand_python_transformation_python_stored_writes_feature_view"
159-
):
160-
print(
161-
f"writing online batch for {table_name} - {feature_name} = {val}"
162-
)
163157
conn.execute(
164158
f"""
165159
UPDATE {table_name}
@@ -177,8 +171,7 @@ def online_write_batch(
177171
),
178172
)
179173

180-
# try:
181-
if True:
174+
try:
182175
conn.execute(
183176
f"""INSERT OR IGNORE INTO {table_name}
184177
(entity_key, feature_name, value, event_ts, created_ts)
@@ -191,13 +184,23 @@ def online_write_batch(
191184
created_ts,
192185
),
193186
)
194-
else:
187+
except Exception as e:
195188
# print(
196189
# f"error writing online batch for {table_name} - {feature_name} = {val}\n {e}"
197190
# )
198191
print(
199192
f'querying all records for table: {conn.execute(f"select * from {table_name}").fetchall()}'
200193
)
194+
def get_table_data(conn):
195+
x = conn.execute(f"select * from sqlite_master").fetchall()
196+
y = conn.execute(f"select * from sqlite_master")
197+
names = list(map(lambda x: x[0], y.description))
198+
return pd.DataFrame(x, columns=names)
199+
200+
df = get_table_data(conn)
201+
tmp = [ conn.execute(f"select count(*) from {table_name}").fetchall() for table_name in df['name'].values if table_name not in ['sqlite_autoindex_test_on_demand_python_transformation_driver_hourly_stats_1', 'test_on_demand_python_transformation_driver_hourly_stats_ek', 'sqlite_autoindex_test_on_demand_python_transformation_python_stored_writes_feature_view_1', 'test_on_demand_python_transformation_python_stored_writes_feature_view_ek']]
202+
print(tmp)
203+
201204
r = conn.execute("""
202205
SELECT * FROM sqlite_master WHERE type='table' and name = 'test_on_demand_python_transformation_python_stored_writes_feature_view';
203206
""")

0 commit comments

Comments
 (0)