Skip to content

fix(csv): warn when empty input produces empty markdown - #2675

Open
languor-daiduode wants to merge 1 commit into
microsoft:mainfrom
languor-daiduode:fix/csv-empty-input-warning
Open

languor-daiduode wants to merge 1 commit into
microsoft:mainfrom
languor-daiduode:fix/csv-empty-input-warning

Conversation

@languor-daiduode

Copy link
Copy Markdown

Fixes #1784.

Summary

  • Emit a UserWarning when CSV/TSV parsing yields no meaningful rows.
  • Preserve the existing empty Markdown result for compatibility.
  • Add regression coverage for empty and whitespace-only input.
  • Make the existing long blank-input case explicitly assert the warning.

Why

Empty CSV input previously produced an empty Markdown document without any diagnostic, making an unintentionally empty source indistinguishable from a successful conversion.

Verification

  • uv run --extra all --with pytest pytest tests/test_csv.py -q: 41 passed
  • uv run --with black black --check src/markitdown/converters/_csv_converter.py tests/test_csv.py: passed

@languor-daiduode

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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.

A one-byte document is generated with no error output

1 participant