fix: Excel values are too large to convert to text

This commit is contained in:
junjun
2025-08-28 17:43:20 +08:00
parent 459057e89b
commit 224b4a6ad3
@@ -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: