Skip to content

Test Excel workbooks with format: xlsx - #1720

Draft
nicolehazel wants to merge 1 commit into
datacontract:mainfrom
nicolehazel:feat/xlsx-test-format
Draft

nicolehazel wants to merge 1 commit into
datacontract:mainfrom
nicolehazel:feat/xlsx-test-format

Conversation

@nicolehazel

Copy link
Copy Markdown

Closes #1717

Adds format: xlsx to datacontract test, read through DuckDB's excel extension, with one sheet per schema named by its physicalName.

Each sheet is read twice and the reads are lined up row by row: once typed, so Excel dates (numbers with a date format) arrive as dates, and once as text, so a cell of the wrong type is still seen. A type check per column counts the cells that have a value but not the contract's type.

Possible follow-up: show the offending cells under --include-failed-samples, which today samples only missing, invalid and duplicate counts.

  • Tests pass (uv run pytest)
  • Code formatted (uv run ruff check --fix && uv run ruff format)
  • Docs updated (if relevant)
  • CHANGELOG.md entry added

Co-authored by a human (@nicolehazel) and Claude Code.

Read each sheet through DuckDB's excel extension, one sheet per schema
named by its physicalName. The sheet is read typed and as text, lined up
row by row, so Excel dates arrive as dates and a cell of the wrong type
fails its column's type check.

Closes datacontract#1717

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

Support format: xlsx in datacontract test (DuckDB excel extension)

1 participant