fix: fall back from empty Docling native chunks#15601
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 (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughParser conditional logic now only short-circuits on native Docling chunked responses if returned ChangesDocling Parser Chunked Response Fallback
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
test/unit_test/deepdoc/parser/test_docling_parser_remote.py (1)
58-74:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAdd a pytest priority marker to this test.
This new test is missing the required
p1/p2/p3priority marker.Proposed patch
from __future__ import annotations import importlib.util import sys import types from pathlib import Path +import pytest @@ +@pytest.mark.p1 def test_remote_chunked_200_standard_payload_falls_back(monkeypatch):As per coding guidelines
test/**/*.py: Use pytest with priority markers (p1/p2/p3) for Python testing.🤖 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/deepdoc/parser/test_docling_parser_remote.py` around lines 58 - 74, The test function test_remote_chunked_200_standard_payload_falls_back is missing a pytest priority marker; add the appropriate marker decorator (e.g., `@pytest.mark.p1` or p2/p3 as required by the test classification) above the function and ensure pytest is imported in the file (add "import pytest" if absent) so the marker is recognized; keep the existing assertions and behavior and only add the marker decorator to the function definition.
🤖 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.
Outside diff comments:
In `@test/unit_test/deepdoc/parser/test_docling_parser_remote.py`:
- Around line 58-74: The test function
test_remote_chunked_200_standard_payload_falls_back is missing a pytest priority
marker; add the appropriate marker decorator (e.g., `@pytest.mark.p1` or p2/p3 as
required by the test classification) above the function and ensure pytest is
imported in the file (add "import pytest" if absent) so the marker is
recognized; keep the existing assertions and behavior and only add the marker
decorator to the function definition.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 285eb5c2-93b5-49b1-acb4-7568544c4ac9
📒 Files selected for processing (2)
deepdoc/parser/docling_parser.pytest/unit_test/deepdoc/parser/test_docling_parser_remote.py
|
Pushed a small follow-up for the test priority marker flagged by CodeRabbit. Validation run locally:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #15601 +/- ##
=======================================
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:
|
Summary
Why
Older external Docling servers can accept a request containing
do_chunking: trueand still return the standard conversion response shape. The current code treats any HTTP 200 from the chunked request as a native chunk response, finds no chunk entries, and returns zero sections without trying the standard response parser.Fixes #15569.
Validation
python -m pytest test\\unit_test\\deepdoc\\parser\\test_docling_parser_remote.py -qpython -m py_compile deepdoc\\parser\\docling_parser.py test\\unit_test\\deepdoc\\parser\\test_docling_parser_remote.pypython -m ruff check deepdoc\\parser\\docling_parser.py test\\unit_test\\deepdoc\\parser\\test_docling_parser_remote.pygit diff --check