Skip to content

fix(rag/app): separate parse progress counts - #19586

Merged
wangq8 merged 4 commits into
infiniflow:0.27.xfrom
MarMarLabs:fix/rag-app-progress-separator
Oct 21, 2026
Merged

wangq8 merged 4 commits into
infiniflow:0.27.xfrom
MarMarLabs:fix/rag-app-progress-separator

Conversation

@MarMarLabs

@MarMarLabs MarMarLabs commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Eight progress callbacks across rag/app/qa.py and rag/app/table.py build 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 is malformed row and whose second line is What is X?,X is a thing, and one parsed pair plus one failed row reads Extract Q&A: 11 failure, line: 1.... A table CSV with one short row reads Extract records: 0~11 failure, line: 0.... This text is progress_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 shape rag/app/qa.py:72 has 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.py carries 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.py runs qa.chunk and table.chunk over 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 merges upstream/0.27.x at 9db2ebd7328 into this branch.

  • new module on the change, 4 passed
  • new module with test_qa_csv.py, test_qa_excel.py and test_table_chunk_column_roles.py, 41 passed
  • new module against unchanged production code, 4 failed, reading Extract Q&A: 11 failure, line: 1... and Extract records: 0~11 failure, line: 0...
  • qa.py changed and table.py left as it was, 2 failed and 2 passed, both table cases still collide
  • whole test/unit_test tree under the pytest command run_tests.py uses, selecting the new module, test_qa_csv.py, test_qa_excel.py, test_table_chunk_column_roles.py and test_parsers_empty_binary.py, 54 passed
  • whole test/unit_test tree under the pytest command run_tests.py uses, selecting the new module, test_gaussdb_table_chunk_column_roles.py and test_parsers_empty_binary.py, 20 passed
  • ruff check and ruff format --check on the three changed files, clean

The qa.py callbacks date from #50 and the table.py ones from #55, and both are in every release since v0.1.0.

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.
@coderabbitai

coderabbitai Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 5ad0198d-c544-43c1-8ded-05a989af7448

📥 Commits

Reviewing files that changed from the base of the PR and between 409247c and dcf7ac2.

📒 Files selected for processing (1)
  • rag/app/qa.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • rag/app/qa.py

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📝 Walkthrough

The change updates Excel, TXT, and CSV parser progress messages to include punctuation and spacing after extracted counts. New tests verify that QA and table parser messages separate parsed counts from failure counts.

Changes: Progress message formatting

Layer / File(s) Summary
Parser progress output
rag/app/qa.py, rag/app/table.py
Excel, TXT, and CSV progress messages now include a trailing period and space after extracted counts.
Progress message regression tests
test/unit_test/rag/app/test_parse_progress_message.py
New tests use malformed rows and verify separators between parsed counts and failure counts.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 3d323

The progress-message formatting update has no identified merge-blocking risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely describes the main change: separating parse progress counts in the RAG application.
Description check Passed The description includes the required Summary section and explains the issue, implementation, scope, tests, and validation results in sufficient detail.
  • Fix all pre-merge checks with AI

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit sees the counts align
A dot and space now mark each line
QA and tables speak with care
Tests catch failures in the air
The parsing trail is clear and fine

Comment @coderabbitai help to get the list of available commands.

@xugangqiang xugangqiang added the ci Continue Integration label Sep 14, 2026
@xugangqiang

Copy link
Copy Markdown
Collaborator

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

codecov Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.21%. Comparing base (5e98b50) to head (86d8361).
⚠️ Report is 13 commits behind head on 0.27.x.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@MarMarLabs

Copy link
Copy Markdown
Contributor Author

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.

@MarMarLabs MarMarLabs closed this Sep 28, 2026
@MarMarLabs MarMarLabs reopened this Oct 20, 2026
@MarMarLabs
MarMarLabs changed the base branch from main to 0.27.x October 20, 2026 13:24
@MarMarLabs

Copy link
Copy Markdown
Contributor Author

Reopening this against 0.27.x per #20287, where rag/app/qa.py still turns one parsed pair and one failed row into Extract Q&A: 11 failure, line: 1.... I merged 0.27.x at 9db2ebd7328 into the branch. The 4 new tests pass, and 41 pass together with the existing Q&A and table tests.

@wangq8
wangq8 merged commit 6ed7761 into infiniflow:0.27.x Oct 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants