Skip to content

Commit 224b4a6

Browse files
committed
fix: Excel values are too large to convert to text
1 parent 459057e commit 224b4a6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

backend/apps/datasource/api/datasource.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,11 @@ def inner():
301301

302302

303303
def insert_pg(df, tableName, engine):
304+
# fix field type
305+
for i in range(len(df.dtypes)):
306+
if str(df.dtypes[i]) == 'uint64':
307+
df[str(df.columns[i])] = df[str(df.columns[i])].astype('string')
308+
304309
conn = engine.raw_connection()
305310
cursor = conn.cursor()
306311
try:

0 commit comments

Comments
 (0)