Repository navigation
fix(rag/app): separate parse progress counts - #19586
Conversation
Eight parse progress callbacks in rag/app/qa.py and rag/app/table.py append the failure count straight onto the count they have just formatted, so one parsed pair and one failed row reach the dataset page as "Extract Q&A: 11 failure, line: 1...". Each of the eight now closes its count with ". " before the conditional suffix. That is the shape rag/app/qa.py:69 has carried since infiniflow#55, and infiniflow#4426 kept it through a relabel. Labels, the failure list truncation and the progress values are untouched, and line 69 itself stays as it is. rag/app/tag.py carries the same four callbacks but never records a failed line, so its text cannot collide and it is left alone.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
LGTM |
One file conflicted, rag/app/qa.py, in five places. Upstream 7aa012f swept the file from str.format to f-strings, and this branch had added the ". " separator to the same progress lines. Took upstream's f-string form and re-applied the separator on top of it, so none of the conversion is lost. That same upstream commit kept the separator on the one line that already carried it, the Extract pairs callback at 0.6, which is the shape the other five lines now match. rag/app/table.py needed no resolution. Upstream has not touched it since the merge base, so its lines keep the .format style of the code around them. Checks after the merge: the four progress tests pass together with test_qa_csv, test_qa_excel and test_table_chunk_column_roles, 29 tests. Against clean upstream 7aa012f the same four fail, reporting "Extract records: 0~31 failure, line: 0..." for a three row file with one bad row. ruff reports no findings on the three changed files.
ragflow_tests_infinity (python) failed on dcf7ac2 before it ran a single test. The RAGFlow container never passed the readiness check inside the five minute window, and the stack was slow throughout: compose took 61 seconds to create the containers and mysql reported healthy more than two minutes after nats. ragflow_tests_elasticsearch (python) passed on that same commit, over the same startup path, so the change is not implicated. sep-tests reruns only on synchronize or a label event, so this empty commit is the retrigger.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 0.27.x #19586 +/- ##
==========================================
+ Coverage 38.11% 38.21% +0.10%
==========================================
Files 54 54
Lines 15533 15533
Branches 125 125
==========================================
+ Hits 5920 5936 +16
+ Misses 9585 9569 -16
Partials 28 28 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Closing this one. The Python parsers it fixed, rag/app/qa.py and rag/app/table.py, were removed in #20289, and the progress messages it separated no longer exist anywhere on main. Thanks for the LGTM, @xugangqiang. |
|
Reopening this against |
Summary
Eight progress callbacks across
rag/app/qa.pyandrag/app/table.pybuild their text as a formatted count followed by a conditional"<n> failure, line: ..."suffix, with nothing between the two numbers. Upload a Q&A CSV whose first line ismalformed rowand whose second line isWhat is X?,X is a thing, and one parsed pair plus one failed row readsExtract Q&A: 11 failure, line: 1.... A table CSV with one short row readsExtract records: 0~11 failure, line: 0.... This text isprogress_msg, which the parsing card on the dataset page renders, so it is what a user watches while a document is parsed.Each of the eight now closes its count with
.before the suffix. That is the shaperag/app/qa.py:72has carried since #55, and #4426 kept it through a relabel, so that site is left as it is. Labels, the failure list truncation and the progress values are untouched. Where a parse has no failed rows the count now ends with a period, which is already what line 72 produces today.rag/app/tag.pycarries the same four callbacks but never records a failed line, so its text cannot collide and it is left alone.This PR now targets
0.27.x, per #20287.Checks
New module
test/unit_test/rag/app/test_parse_progress_message.pyrunsqa.chunkandtable.chunkover small in-memory CSV and TXT inputs carrying one malformed row each, and asserts that something other than a digit stands between the two counts.I measured the counts below locally on
86d8361d022, which mergesupstream/0.27.xat9db2ebd7328into this branch.test_qa_csv.py,test_qa_excel.pyandtest_table_chunk_column_roles.py, 41 passedExtract Q&A: 11 failure, line: 1...andExtract records: 0~11 failure, line: 0...qa.pychanged andtable.pyleft as it was, 2 failed and 2 passed, both table cases still collidetest/unit_testtree under the pytest commandrun_tests.pyuses, selecting the new module,test_qa_csv.py,test_qa_excel.py,test_table_chunk_column_roles.pyandtest_parsers_empty_binary.py, 54 passedtest/unit_testtree under the pytest commandrun_tests.pyuses, selecting the new module,test_gaussdb_table_chunk_column_roles.pyandtest_parsers_empty_binary.py, 20 passedruff checkandruff format --checkon the three changed files, cleanThe
qa.pycallbacks date from #50 and thetable.pyones from #55, and both are in every release since v0.1.0.