Repository navigation
fix(qa): preserve final CSV pair row number - #16433
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughIn ChangesCSV Q&A row number fix
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/unit_test/rag/app/test_qa_csv.py (1)
19-22: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winScope the
pkg_resourceswarning suppression to the specific import path.This runs during test-module import, so it mutates the process-wide warning filters for the rest of collection and can hide the same deprecation elsewhere in the suite. Please confine the suppression to the exact workaround instead of installing a global filter from one test module.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@test/unit_test/rag/app/test_qa_csv.py` around lines 19 - 22, The warning suppression in the test module is too broad because it installs a process-wide filter at import time. Move the pkg_resources deprecation suppression to the exact import workaround, using a local warnings context around the pkg_resources import in test_qa_csv so the rest of collection is unaffected. Keep the fix scoped to the import path and preserve the stabilization for the xgboost import.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@test/unit_test/rag/app/test_qa_csv.py`:
- Around line 19-22: The warning suppression in the test module is too broad
because it installs a process-wide filter at import time. Move the pkg_resources
deprecation suppression to the exact import workaround, using a local warnings
context around the pkg_resources import in test_qa_csv so the rest of collection
is unaffected. Keep the fix scoped to the import path and preserve the
stabilization for the xgboost import.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1f94df06-c824-4f0e-b1c9-07df0cd668be
📒 Files selected for processing (2)
rag/app/qa.pytest/unit_test/rag/app/test_qa_csv.py
|
Could a maintainer please add the Local verification passed:
|
a6f504b to
17a48cd
Compare
841b7a3 to
3a8ff64
Compare
|
Follow-up: branch is current with |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16433 +/- ##
=======================================
Coverage 93.16% 93.16%
=======================================
Files 10 10
Lines 717 717
Branches 118 118
=======================================
Hits 668 668
Misses 29 29
Partials 20 20 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
What problem does this PR solve?
Fixes #16432.
The CSV branch of
rag/app/qa.pyappends the final Q&A pair after thecsv.readerloop finishes. It currently useslen(list(reader))for that final row number, but the reader is exhausted by then, so the final chunk getstop_int: [0].This changes the final CSV append to use
len(lines), matching the existing.txtbranch.Type of change
How has this been tested?
uv sync --group testuv run pytest test/unit_test/rag/app/test_qa_csv.py -quvx ruff check rag/app/qa.py test/unit_test/rag/app/test_qa_csv.pyThe new regression test fails before the fix with
top_int == [0]for the final CSV pair and passes after the change.Checklist