mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 09:17:06 +08:00
fix: Excel values are too large to convert to text
This commit is contained in:
@@ -301,6 +301,11 @@ async def upload_excel(session: SessionDep, file: UploadFile = File(...)):
|
||||
|
||||
|
||||
def insert_pg(df, tableName, engine):
|
||||
# fix field type
|
||||
for i in range(len(df.dtypes)):
|
||||
if str(df.dtypes[i]) == 'uint64':
|
||||
df[str(df.columns[i])] = df[str(df.columns[i])].astype('string')
|
||||
|
||||
conn = engine.raw_connection()
|
||||
cursor = conn.cursor()
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user