Skip to content

Preserve literal NA values and blank cells in Excel conversions - #2499

Open
Kunpeng Xie (pentaoa) wants to merge 1 commit into
microsoft:mainfrom
pentaoa:fix/excel-literal-na-values
Open

Kunpeng Xie (pentaoa) wants to merge 1 commit into
microsoft:mainfrom
pentaoa:fix/excel-literal-na-values

Conversation

@pentaoa

Copy link
Copy Markdown

Fixes #2498.

An Excel row containing NA, NULL, and a blank cell currently becomes | NaN | NaN | NaN |. Disable pandas' default NA-token recognition so literal cell text is preserved and blanks remain empty. Apply the same setting to XLS, XLSX, and the legacy showZeroes repair path.

The regression runs real workbooks through MarkItDown.convert_stream, including a small XLS fixture to avoid adding a workbook-writing test dependency. It checks several NA-like strings, blank cells, and integer values against the resulting Markdown table.

Validation:

  • All three new format/path cases fail before the fix and pass afterward.
  • Five focused Excel and legacy-repair tests pass.
  • Eight existing XLS/XLSX file, hinted-stream, unhinted-stream, and file-URI conversion tests pass.
  • Black and git diff --check pass. The full multi-format suite was not run; this change adds no dependencies.

AI assistance: OpenAI Codex was used for investigation, implementation, and local test execution.

@pentaoa

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.

Excel conversion replaces literal NA/NULL strings and blank cells with NaN

1 participant