Fix too long integer for Table. (#4651)

### What problem does this PR solve?

#4594

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu 2025-01-26 12:54:58 +08:00 committed by GitHub
parent 4011c8f68c
commit c24137bd11
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -102,9 +102,9 @@ def column_data_type(arr):
for a in arr:
if a is None:
continue
if re.match(r"[+-]?[0-9]+(\.0+)?$", str(a).replace("%%", "")):
if re.match(r"[+-]?[0-9]{,19}(\.0+)?$", str(a).replace("%%", "")):
counts["int"] += 1
elif re.match(r"[+-]?[0-9.]+$", str(a).replace("%%", "")):
elif re.match(r"[+-]?[0-9.]{,19}$", str(a).replace("%%", "")):
counts["float"] += 1
elif re.match(r"(true|yes|是|\*|✓|✔|☑|✅|√|false|no|否|⍻|×)$", str(a), flags=re.IGNORECASE):
counts["bool"] += 1