Repository navigation
Conversation
…sniffer Signed-off-by: fanjiahe <fanjiahe@mail.ustc.edu.cn>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
✅ DCO Check Passed Thanks @fanjiahe, all your commits are properly signed off. 🎉 |
Merge Protections🟢 Merge protection satisfied — ready to merge. Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
AI triage (advisory)Checked commit The PR makes the CSV content sniffer skip files that have a plain-text extension such as Topic labels added: CI safety: no concern found. A maintainer must still approve CI. The |
There was a problem hiding this comment.
AI first review (advisory): no blocker found
This review covers the full diff at bb62c82f99. It read the code and did not run it.
The fix works for .txt files, but it changes detection for every .txt file. A .txt file that holds real CSV data used to be read as CSV and now becomes Markdown. The tests do not cover this, and the PR does not say it. The reviewer must decide whether this change is intended.
A maintainer makes the merge decision. This review never approves the pull request.
| The mime type of a CSV file, or None if the content does | ||
| not match any of the format. | ||
| """ | ||
| if (ext or "").lower() in FormatToExtensions[InputFormat.MD]: |
There was a problem hiding this comment.
question: .txt files with real CSV content no longer convert as CSV
A .txt path has no mime from its extension. _mime_from_extension skips MD because txt is also an XML_USPTO extension. _guess_format then sniffs the content, and _detect_csv used to run for .txt files. With this check, a .txt file that holds comma-separated rows returns None. _guess_format then falls back to text/plain and InputFormat.MD. Such a file was InputFormat.CSV before. It is now a Markdown text blob, with no table.
This may be the wanted trade-off, because the issue is about VBA source in .txt. But the PR does not say it and no test covers it. The .txt case in the new test uses VBA source. The notes.text case does not exercise the change: text is in the MD extensions, so _mime_from_extension already returns text/markdown and _detect_csv is never called. The .md case is the same.
Please confirm that .txt files with CSV data should now convert as Markdown. If they should, say so in the PR description. Also add a .txt test with clean CSV content that shows the new result. If they should stay CSV, use a narrower check than the extension alone.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Fixes #5631
Summary
Verification
uff check and
uff format --check on docling/datamodel/document.py and ests/test_input_doc.py — passed.
AI-assisted contribution (human-reviewed and verified locally).