@@ -153,8 +153,13 @@ def online_write_batch(
153153 )
154154
155155 else :
156- if table_name == 'test_on_demand_python_transformation_python_stored_writes_feature_view' :
157- print (f"writing online batch for { table_name } - { feature_name } = { val } " )
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+ )
158163 conn .execute (
159164 f"""
160165 UPDATE { table_name }
@@ -174,20 +179,24 @@ def online_write_batch(
174179
175180 try :
176181 conn .execute (
177- f"""INSERT OR IGNORE INTO { table_name }
182+ f"""INSERT OR IGNORE INTO { table_name }
178183 (entity_key, feature_name, value, event_ts, created_ts)
179184 VALUES (?, ?, ?, ?, ?)""" ,
180- (
181- entity_key_bin ,
182- feature_name ,
183- val .SerializeToString (),
184- timestamp ,
185- created_ts ,
186- ),
187- )
185+ (
186+ entity_key_bin ,
187+ feature_name ,
188+ val .SerializeToString (),
189+ timestamp ,
190+ created_ts ,
191+ ),
192+ )
188193 except Exception as e :
189- print (f"error writing online batch for { table_name } - { feature_name } = { val } \n { e } " )
190- print (f'querying all records for table: { conn .execute (f"select * from { table_name } " ).fetchall ()} ' )
194+ print (
195+ f"error writing online batch for { table_name } - { feature_name } = { val } \n { e } "
196+ )
197+ print (
198+ f'querying all records for table: { conn .execute (f"select * from { table_name } " ).fetchall ()} '
199+ )
191200 if progress :
192201 progress (1 )
193202
@@ -254,7 +263,7 @@ def update(
254263 project = config .project
255264
256265 for table in tables_to_keep :
257- print (f' updating { _table_id (project , table )} ' )
266+ print (f" updating { _table_id (project , table )} " )
258267 conn .execute (
259268 f"CREATE TABLE IF NOT EXISTS { _table_id (project , table )} (entity_key BLOB, feature_name TEXT, value BLOB, vector_value BLOB, event_ts timestamp, created_ts timestamp, PRIMARY KEY(entity_key, feature_name))"
260269 )
0 commit comments