From c24137bd119f8b7cff9a44fa8fcc4f30deba9890 Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Sun, 26 Jan 2025 12:54:58 +0800 Subject: [PATCH] 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) --- rag/app/table.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rag/app/table.py b/rag/app/table.py index 542edec7a68..b35cb105ebd 100644 --- a/rag/app/table.py +++ b/rag/app/table.py @@ -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