Skip to content

Avoid treating extensionless logs as CSV - #2475

Open
Shivansh Sharma (SHAI-shivansh-sharma) wants to merge 1 commit into
microsoft:mainfrom
SHAI-shivansh-sharma:fix-plain-text-sql-log
Open

Avoid treating extensionless logs as CSV#2475
Shivansh Sharma (SHAI-shivansh-sharma) wants to merge 1 commit into
microsoft:mainfrom
SHAI-shivansh-sharma:fix-plain-text-sql-log

Conversation

@SHAI-shivansh-sharma

@SHAI-shivansh-sharma Shivansh Sharma (SHAI-shivansh-sharma) commented Sep 12, 2026

Copy link
Copy Markdown

Summary

  • Avoid treating extensionless plain-text logs from streams/stdin as CSV tables when the content has no CSV-style delimiter.
  • Keep extensionless comma-delimited CSV converting to a Markdown table.
  • Keep explicit .csv inputs on the existing CSV converter path.

Fixes #2474.

Test

  • uv run --with pytest --with-editable . --python 3.12 pytest tests\test_csv_detection.py tests\test_csv_line_endings.py tests\test_csv_blank_runs.py

@SHAI-shivansh-sharma

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@SHAI-shivansh-sharma Shivansh Sharma (SHAI-shivansh-sharma) changed the title Add SQL and log files to plain text converter Avoid treating extensionless logs as CSV Sep 12, 2026
@SHAI-shivansh-sharma

Copy link
Copy Markdown
Author

Thanks for the detailed check. You were right that the original .sql / .log extension-list change did not materially improve the normal CLI or MarkItDown().convert(...) path.

I updated the PR to target the stronger issue you found instead: extensionless log/plain-text streams being inferred as CSV and rendered as a one-column Markdown table. The updated patch now downgrades content-only text/csv guesses to text/plain when there is no CSV-style delimiter evidence, while keeping extensionless comma-delimited CSV converting as a table.

I also added focused coverage for both cases and reran the existing CSV regression tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Extensionless log streams can be rendered as CSV tables

1 participant