Skip to content

Add opt-in filtering for hidden XLSX worksheets - #2456

Open
Mingyang Wu (aprylewu) wants to merge 2 commits into
microsoft:mainfrom
aprylewu:fix/xlsx-hidden-sheet-filter
Open

Add opt-in filtering for hidden XLSX worksheets#2456
Mingyang Wu (aprylewu) wants to merge 2 commits into
microsoft:mainfrom
aprylewu:fix/xlsx-hidden-sheet-filter

Conversation

@aprylewu

Copy link
Copy Markdown

Related to #1073.

XLSX conversion currently includes worksheets marked hidden or veryHidden, so content intended to stay out of the visible workbook also appears in Markdown sent to an LLM. The built-in XLSX converter now accepts include_hidden_sheets=False through the public conversion API:

result = md.convert("test.xlsx", include_hidden_sheets=False)

The default still includes every worksheet for compatibility with existing callers. This implements the issue's requested filtering option; changing the default can be considered separately.

Visible worksheets retain their workbook order. Filtering happens before cell parsing, so excluded sheets do not need to be read into DataFrames. The existing repair for legacy showZeroes sheet views preserves the filtering option when retrying. No new dependencies are added.

Validation:

  • Five new in-memory workbook regressions: 3 failed / 2 passed before, 5 passed after. They cover both hidden states, visible-sheet order, explicit/default inclusion, the legacy repair path, and an invalid numeric cell in an excluded sheet.
  • Existing XLSX regression tests: 2 passed.
  • XLSX/XLS API and CLI conversion vectors: 18 passed.
  • HTML converter tests: 11 passed.
  • pre-commit run --all-files and git diff --check: passed.

Developed and tested with OpenAI Codex assistance.

@aprylewu

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.

1 participant