fix: always detect CSV files as text/csv on Windows #13485
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.45) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 400 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.359
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #13485"
general
weight: 0.35
simin-yuan
Related Issues
test_from_file_path_guess_mime_type[spam.csv-...]fails there)Proposed Changes:
_guess_mime_typeasks themimetypesmodule first and only falls back toCUSTOM_MIMETYPESfor extensions it does not know. On Windows,mimetypesreads the registry, where Excel registers.csvasapplication/vnd.ms-excel. So on any Windows machine with Excel installed, CSV files are no longertext/csv:MultiFileConverterroutes CSV bytext/csv, so CSV files are silently skipped instead of reachingCSVToDocument. This adds.csvtoCUSTOM_MIMETYPES(the dict that already pins.mdand.msg, and takes precedence over the system guess), so the result no longer depends on the registry. Behaviour on Linux and macOS is unchanged, they already returntext/csv.How did you test it?
mimetypes.guess_typeto returnapplication/vnd.ms-exceland checks_guess_mime_typestill returnstext/csv(also for upper-case.CSV); it fails without the change..csvisapplication/vnd.ms-excel):FileTypeRouter(["text/csv"])goes fromunclassifiedtotext/csvfor a real CSV file; the previously failingtest_byte_stream.py::test_from_file_path_guess_mime_type[spam.csv-...]passes.test/utils,test/dataclasses/test_byte_stream.py,test/components/routers,test/components/converters/test_multi_file_converter.py: 265 passed, 39 skipped. Rest of the non-integration unit suite on Windows: 7087 passed, 1 failed (the csv test above).pre-commit runon the three changed files: all hooks pass (ruff check, ruff format, codespell, release-note-backticks, yaml and whitespace checks; actionlint skipped because no workflow file changed).Notes for the reviewer
Release note added. If you would rather not pin the type in
CUSTOM_MIMETYPES, the alternative is to skip the system guess for.csvinside_guess_mime_type; I kept the existing mechanism.Checklist
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:and added!in case the PR includes breaking changes.