Skip to content

Filesystem: Add reader for Excel XLSX files - #123

Merged
amotl merged 1 commit into
mainfrom
excel
Jul 13, 2026
Merged

Filesystem: Add reader for Excel XLSX files#123
amotl merged 1 commit into
mainfrom
excel

Conversation

@amotl

@amotl amotl commented Jun 28, 2026

Copy link
Copy Markdown
Member

About

A connector for reading spreadsheets from Excel XLSX workbook files was dearly missing. It uses Polars' read_excel.

References

@codecov

codecov Bot commented Jun 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.40%. Comparing base (268143f) to head (ec5a2e1).

Files with missing lines Patch % Lines
omniload/source/filesystem/adapter.py 77.77% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #123      +/-   ##
==========================================
+ Coverage   54.33%   54.40%   +0.06%     
==========================================
  Files         203      203              
  Lines        9574     9582       +8     
==========================================
+ Hits         5202     5213      +11     
+ Misses       4372     4369       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread omniload/core/registry.py Outdated
Comment thread tests/warehouse/filesystem/test_excel.py
Comment thread tests/warehouse/filesystem/test_excel.py
Comment thread omniload/source/filesystem/adapter.py Outdated
Comment thread omniload/source/filesystem/format/readers.py Outdated
Comment thread omniload/util/endpoint.py Outdated
Comment thread omniload/source/filesystem/adapter.py Outdated
Comment thread omniload/source/filesystem/api.py Outdated
Comment thread tests/main/filesystem/test_local.py
Comment thread tests/warehouse/filesystem/test_excel.py
@amotl

This comment was marked as resolved.

@coderabbitai

This comment was marked as resolved.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@amotl, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 28 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fe18fd53-753f-4358-8c55-7cb95f0c38df

📥 Commits

Reviewing files that changed from the base of the PR and between a6682b1 and cf1c6a5.

📒 Files selected for processing (16)
  • docs/changelog.md
  • docs/supported-sources/file.md
  • docs/supported-sources/xlsx.md
  • omniload/source/filesystem/adapter.py
  • omniload/source/filesystem/format/readers.py
  • omniload/source/filesystem/format/registry.py
  • omniload/source/filesystem/impl/local.py
  • omniload/source/filesystem/model.py
  • omniload/source/filesystem/router.py
  • omniload/target/filesystem/local.py
  • omniload/target/model.py
  • pyproject.toml
  • tests/main/filesystem/test_local_write.py
  • tests/main/filesystem/test_remote.py
  • tests/main/filesystem/test_source_hints.py
  • tests/warehouse/filesystem/test_excel.py

Walkthrough

Adds XLSX ingestion to filesystem sources, including format detection, worksheet hints, Polars-based reading, local destination naming, runtime dependencies, integration tests, and documentation updates.

Changes

XLSX filesystem support

Layer / File(s) Summary
Reader and adapter wiring
omniload/source/filesystem/format/readers.py, omniload/source/filesystem/adapter.py
Adds read_excel, exposes it through the reader resource, and binds XLSX reader hints such as sheet_name.
Format registration and hint contract
omniload/source/filesystem/format/registry.py, omniload/source/filesystem/router.py, omniload/source/filesystem/model.py, omniload/source/filesystem/impl/local.py, tests/main/filesystem/*
Maps xlsx to read_excel and updates filesystem hint examples and expectations from sheet to sheet_name.
Destination filename handling
omniload/target/model.py, omniload/target/filesystem/local.py
Adds the default public dataset and derives the destination table name from the URI filename when no table is supplied.
Dependencies and ingestion validation
pyproject.toml, tests/warehouse/filesystem/test_excel.py, tests/main/filesystem/test_remote.py
Adds Excel runtime dependencies and tests explicit, default, and invalid worksheet selection.
XLSX documentation
docs/supported-sources/file.md, docs/supported-sources/xlsx.md, docs/changelog.md
Documents XLSX detection, hints, supported source schemes, ingestion behavior, examples, and the in-progress changelog entry.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SourceURI
  participant FilesystemAdapter
  participant ExcelReader
  participant Polars
  SourceURI->>FilesystemAdapter: Parse xlsx format and sheet_name hint
  FilesystemAdapter->>ExcelReader: Select read_excel and bind hints
  ExcelReader->>Polars: Read workbook bytes
  Polars-->>ExcelReader: Return worksheet rows
  ExcelReader-->>FilesystemAdapter: Yield named records
Loading

Possibly related PRs

Suggested reviewers: hampsterx

Poem

I’m a rabbit with a workbook to read,
Hopping through sheets at lightning speed.
XLSX rows bloom, hints point the way,
DuckDB welcomes the harvest today.
Hop, hop—Excel joins the array!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 64.71% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding XLSX file reading support.
Description check ✅ Passed The description matches the changeset by describing new XLSX spreadsheet reading support.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch excel

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]

This comment was marked as resolved.

@amotl

This comment was marked as resolved.

@coderabbitai

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as low quality.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as low quality.

coderabbitai[bot]

This comment was marked as resolved.

@amotl amotl changed the title Connectors: Add source adapter for the XLSX file format Filesystem: Add reader for Excel XLSX files Jul 13, 2026
@amotl
amotl force-pushed the excel branch 2 times, most recently from 0709ba1 to 12234a6 Compare July 13, 2026 22:07
coderabbitai[bot]

This comment was marked as low quality.

coderabbitai[bot]

This comment was marked as resolved.

@amotl amotl left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few more comments from self-review.

Comment on lines +153 to +154
elif ref.reader_name == "read_excel":
reader = reader.bind(**ref.hints)

@amotl amotl Jul 13, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forwarding omniload reader hints to Polars read_xyz kwargs 1:1 currently just barely works for string argument types, so this basic implementation does not support forwarding all arguments just yet.

Because no type conversion takes place, it is currently not possible to convey int, float, bool, or container types. It could be another candidate for a more thorough approach using Pydantic in the long run.

Short-term, in order to forward all kwargs to polars.read_excel properly, let's either supply a custom mapper, or introspect the target read_excel function to learn about relevant types at runtime to be able to automatically cast them to their expected types.

For list and dict types, let's use compact JSON as serialized representation (no whitespace), when possible.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +73 to +74
workbook. The loader is using [polars.read_excel], please consult its documentation
about all available parameters and their meaning.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all arguments of polars.read_excel can be forwarded yet. Currently, that works only for str types, see my last comment.

Comment thread docs/supported-sources/file.md
Comment thread tests/warehouse/filesystem/test_excel.py
@amotl
amotl force-pushed the excel branch 2 times, most recently from a6682b1 to babb3d4 Compare July 13, 2026 23:13
coderabbitai[bot]

This comment was marked as resolved.

@amotl
amotl force-pushed the excel branch 4 times, most recently from 3eb73a2 to cf1c6a5 Compare July 13, 2026 23:22
@amotl
amotl marked this pull request as ready for review July 13, 2026 23:43
@amotl
amotl merged commit 9a0b3a7 into main Jul 13, 2026
14 checks passed
@amotl
amotl deleted the excel branch July 13, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coderabbit-review Tell CodeRabbit to review the patch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant