Skip to content

Commit 8eeca3c

Browse files
committed
test to enforce float formatter
1 parent a301049 commit 8eeca3c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

genie/load.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,12 @@ def store_database(
315315
table_entity = syn.get(database_table_synid)
316316
# upsert table with new and updated rows
317317
if not all_updates.empty:
318-
Table(id=database_table_synid).store_rows(all_updates)
319-
logger.info(f"Upserting {len(all_updates)} rows from {table_entity.name} table")
318+
# TEST convert to csv to enforce float_format="%.12g" in store_rows
319+
with tempfile.TemporaryDirectory() as tmpdir:
320+
tmpfile = os.path.join(tmpdir, "all_updates.csv")
321+
all_updates.to_csv(tmpfile)
322+
Table(id=database_table_synid).store_rows(tmpfile)
323+
logger.info(f"Upserting {len(all_updates)} rows from {table_entity.name} table")
320324
# delete rows from the database
321325
if not to_delete_rows.empty:
322326
Table(id=database_table_synid).delete_rows(df = to_delete_rows)

0 commit comments

Comments
 (0)