aboutsummaryrefslogtreecommitdiffstats
path: root/python/citco_ops/remote.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/citco_ops/remote.py')
-rw-r--r--python/citco_ops/remote.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/python/citco_ops/remote.py b/python/citco_ops/remote.py
index 06fa69f7..31e81087 100644
--- a/python/citco_ops/remote.py
+++ b/python/citco_ops/remote.py
@@ -72,9 +72,12 @@ class Report:
df = pd.read_csv(fh)
return load_citco_report(df, self.ped_func(self.most_recent_report))
- def to_db(self, date):
- # with self._conn.cursor() as c:
- # c.execute(f"DELETE FROM {self.table} WHERE period_end_date= %s", (prev_business_day(self.date),))
+ def to_db(self):
+ with self._conn.cursor() as c:
+ c.execute(
+ f"DELETE FROM {self.table} WHERE period_end_date= %s",
+ (prev_business_day(self.date),),
+ )
self._conn.commit()
df = self.to_df()
df.to_sql(self.table, dawn_engine, if_exists="append", index=False)