From 4bd01307592566a0a361756ddfb82b0acbecd39b Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 11 May 2023 20:27:38 +0800 Subject: [PATCH] bugfix --- dataloader/dataloader.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/dataloader/dataloader.py b/dataloader/dataloader.py index 064176c..04e0cc5 100755 --- a/dataloader/dataloader.py +++ b/dataloader/dataloader.py @@ -14,7 +14,7 @@ class CBObject: async def handle(self,ws): db = DBPools() async with db.sqlorContext(self.db) as sor: - delete_sql = "delete from %s" % self.tbl + delete_sql = "TRUNCATE TABLE %s" % self.tbl await sor.sqlExe(delete_sql, {}) info = await sor.I(self.tbl) for rec in getRecord(ws): @@ -24,12 +24,6 @@ class CBObject: rec = convrec(info, rec) await sor.C(self.tbl, rec) -typesconv = { - "int":int, - "float":float, - "str":str, -} - def getRecord(ws): names = [] types = [] @@ -45,7 +39,6 @@ def getRecord(ws): else: dic = {} for j,c in enumerate(r): - # tf = typesconv.get(types[j],None) v = c.value dic[names[j]] = v yield dic