Update table.py to convert clmns to string #414
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
When handling some excel file, following error might occur, looks like some clmns item could be in type 'int':
[INFO] [2024-04-17 16:01:40,644] [_internal._log] [line:96]: 172.29.0.6 - - [17/Apr/2024 16:01:40] "GET /v1/document/list?kb_id=615d3698fc6711ee85920242ac140006&page=1&page_size=10 HTTP/1.1" 200 - Traceback (most recent call last):
File "/ragflow/rag/svr/task_executor.py", line 130, in build
cks = chunker.chunk(row["name"], binary=binary, from_page=row["from_page"],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/ragflow/rag/app/table.py", line 198, in chunk
py_clmns = [
^
File "/ragflow/rag/app/table.py", line 200, in
re.sub(
File "/root/miniconda3/envs/py11/lib/python3.11/re/init.py", line 185, in sub
return _compile(pattern, flags).sub(repl, string, count)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: expected string or bytes-like object, got 'int'
Type of change