Comment out unused code in CreateTempTables and update_tvupdates methods for future verification; streamline set_apienv function by removing jget parameter and related logic.

This commit is contained in:
2025-12-12 13:48:05 -05:00
parent 3447ba369f
commit 99a2d78032
3 changed files with 20 additions and 34 deletions
+6 -7
View File
@@ -250,7 +250,6 @@ class CreateTempTables():
pass
self.create(Base, engine, metadata, session, self.tablelist)
session.commit()
#self.send(tablelist)
def settables(self, metadata, engine):
tablelist = []
@@ -379,12 +378,12 @@ class CreateTempTables():
schema = "updates",
extend_existing=True)
tablelist.append(countries)
tvupdates = Table('tvupdates', metadata,
Column('seriesid', BIGINT, primary_key = True),
Column('timestamp', VARCHAR(15)),
schema = "updates",
extend_existing=True)
tablelist.append(tvupdates)
# tvupdates = Table('tvupdates', metadata,
# Column('seriesid', BIGINT, primary_key = True),
# Column('timestamp', VARCHAR(15)),
# schema = "updates",
# extend_existing=True)
# tablelist.append(tvupdates)
return(tablelist)
def create(self, Base, engine, metadata, session, tablelist):
+5 -2
View File
@@ -27,8 +27,11 @@ class Dbexec():
# Commented out code for applying updates for now. Will re-enable later after downloads are verified.
print('Applying updates to table.')
with engine.connect() as conn:
# conn.execute(text(f"truncate table {tablename}"))
# conn.execute(tablename.insert(), updatelist)
conn.execute(text(f"truncate table {tablename}"))
for key, value in available_updates.items():
seriesid = str(key)
timestamp = value
conn.execute(text(f"INSERT INTO {tablename} (seriesid, timestamp) VALUES (:seriesid, :timestamp)"), {'seriesid': seriesid, 'timestamp': timestamp})
conn.commit()
print('Update of tvupdates table is complete.')