From 940d044f12f31d1d7a4b7b7240cede2de707f7cf Mon Sep 17 00:00:00 2001 From: "gowthaman.b" Date: Tue, 13 Jun 2023 09:38:22 +0530 Subject: [PATCH] remove print statements --- main.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/main.py b/main.py index b39f796..e4d36cb 100644 --- a/main.py +++ b/main.py @@ -1,12 +1,7 @@ -# This is a sample Python script. import ijson import sqlite3 import pandas as pd -from glob import glob -from os.path import expanduser -# Press ⌃R to execute it or replace it with your code. -# Press Double ⇧ to search everywhere for classes, files, tool windows, actions, and settings. flat_keys = ["cost_center", "location", "customer"] extract_keys = { @@ -76,8 +71,8 @@ def make_table(tbl_name, cols): syspk = "syspk integer primary key autoincrement" other_cols = ', '.join([f"{f} TEXT" for f in cols]) create_tbl_sql = f"create table if not exists {tbl_name} ({syspk}, {other_cols})" - print(f"{tbl_name} = ", cols) - print(f"{tbl_name} = ", create_tbl_sql) + # print(f"{tbl_name} = ", cols) + # print(f"{tbl_name} = ", create_tbl_sql) cur.execute(create_tbl_sql) @@ -91,11 +86,11 @@ def write_to_database(tbl, cols): ["?" for x in keys] ) - values = tuple([str(cols[k]) for k in keys]) + values = tuple([str(cols[k]).strip() for k in keys]) sql = f"insert into {tbl} ({col_names}) values({value_placeholders})" - print(f"execute {sql} with values {values}") + # print(f"execute {sql} with values {values}") cur.execute(sql, values) @@ -105,7 +100,7 @@ def make_csv_from_tables(): tbls = [] for (tbl,) in cur.fetchall(): - print("tbl = ", tbl) + # print("tbl = ", tbl) if tbl.find("transactions") == 0: tbls.append(tbl)