From ce140f139342aecadfb79fefaa86951a98c352fb Mon Sep 17 00:00:00 2001 From: Stephen Hu Date: Mon, 14 Jul 2025 17:51:26 +0800 Subject: [PATCH] Fix:Better Support Table Value Type (#8822) ### What problem does this PR solve? https://github.com/infiniflow/ragflow/issues/8782 ### 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 90b4c2849..34e0254de 100644 --- a/rag/app/table.py +++ b/rag/app/table.py @@ -96,12 +96,12 @@ def column_data_type(arr): for a in arr: if a is None: continue - if re.match(r"[+-]?[0-9]+$", str(a).replace("%%", "")): + if re.match(r"[+-]?[0-9]+$", str(a).replace("%%", "")) and not str(a).replace("%%", "").startswith("0"): counts["int"] += 1 if int(str(a)) > 2**63 - 1: float_flag = True break - elif re.match(r"[+-]?[0-9.]{,19}$", str(a).replace("%%", "")): + elif re.match(r"[+-]?[0-9.]{,19}$", str(a).replace("%%", "")) and not str(a).replace("%%", "").startswith("0"): counts["float"] += 1 elif re.match(r"(true|yes|是|\*|✓|✔|☑|✅|√|false|no|否|⍻|×)$", str(a), flags=re.IGNORECASE): counts["bool"] += 1