Kevin Hu commited on
Commit
cd19d72
Β·
1 Parent(s): 3828585

Fix too long integer for `Table`. (#4651)

Browse files

### What problem does this PR solve?

#4594

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

Files changed (1) hide show
  1. rag/app/table.py +2 -2
rag/app/table.py CHANGED
@@ -102,9 +102,9 @@ def column_data_type(arr):
102
  for a in arr:
103
  if a is None:
104
  continue
105
- if re.match(r"[+-]?[0-9]+(\.0+)?$", str(a).replace("%%", "")):
106
  counts["int"] += 1
107
- elif re.match(r"[+-]?[0-9.]+$", str(a).replace("%%", "")):
108
  counts["float"] += 1
109
  elif re.match(r"(true|yes|是|\*|βœ“|βœ”|β˜‘|βœ…|√|false|no|否|⍻|Γ—)$", str(a), flags=re.IGNORECASE):
110
  counts["bool"] += 1
 
102
  for a in arr:
103
  if a is None:
104
  continue
105
+ if re.match(r"[+-]?[0-9]{,19}(\.0+)?$", str(a).replace("%%", "")):
106
  counts["int"] += 1
107
+ elif re.match(r"[+-]?[0-9.]{,19}$", str(a).replace("%%", "")):
108
  counts["float"] += 1
109
  elif re.match(r"(true|yes|是|\*|βœ“|βœ”|β˜‘|βœ…|√|false|no|否|⍻|Γ—)$", str(a), flags=re.IGNORECASE):
110
  counts["bool"] += 1