Skip to content

docs: clarify row iterator column offsets - #237

Open
ryanduguid wants to merge 3 commits into
dimastbk:masterfrom
ryanduguid:docs/iterator-column-offsets
Open

ryanduguid wants to merge 3 commits into
dimastbk:masterfrom
ryanduguid:docs/iterator-column-offsets

Conversation

@ryanduguid

@ryanduguid ryanduguid commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Clarify the different offset handling of iter_rows() and to_python() in the README and iterator docstring. For cells C3/D3, the iterator yields two blank rows of width two before the data, while to_python(skip_empty_area=False) retains the leading columns as well.

Explain how the second item of sheet.start identifies the column offset for a non-empty sheet. Closes #177.

Evidence

  • A synthetic C3/D3 workbook reproduces the documented behaviour with the published 0.8.2 Windows wheel.
  • Windows Python 3.12: pytest tests/test_base.py -q passed all 34 cases with the released wheel; mypy and stubtest also passed.
  • Linux Python 3.12.14 with pandas 3.0.6: compiled the current extension with pip install -e ., then pytest reported 51 passed and one existing expected failure for the OdfReader timedelta case.
  • pre-commit run --all-files passed every hook, including Rust formatting, Clippy, mypy and stubtest. Whitespace checks pass, and the checked Linux patch matches this PR exactly.
  • The stub's parsed structure is identical after removing docstrings.

Risk

This is a reversible documentation change affecting the README and iterator docstring. The offset explanation is checked against the current Rust source and the released wheel.

Unverified

Rust unit tests, the full Windows suite, and the remaining Python/OS and PyEmscripten combinations were not run. Upstream CI awaits maintainer approval.

CI workflow maintenance

Use Ubuntu 24.04 for the affected Linux jobs. Keep the existing event, permission and test-matrix contracts.

Pin the computed Linux runner fallback while preserving explicit, Windows and macOS selections.

Evidence

The previous head reported 24 matching action-runtime or runner annotations. Actionlint reports no new diagnostics against the previous workflow files; existing diagnostics remain. The Git whitespace check passes.

Risk

Action or runner upgrades can affect CI behaviour. The workflow changes can be reverted.

Unverified

Hosted CI observed at 2026-10-17T11:24:12Z for 998777d: 2 skipped, 32 success. No action-runtime or Ubuntu-label annotations were reported. Application tests were not run locally for these workflow changes.

Summary by CodeRabbit

  • Documentation
    • Clarified how iter_rows() handles leading empty rows and columns, including how to locate the first included column.
    • Documented that to_python() skips empty areas by default, and that skip_empty_area=False preserves the row and column offsets.
  • Chores
    • Updated Linux CI jobs to use Ubuntu 24.04; other operating systems retain their existing runner defaults.

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b078ee3f-1a21-42f0-855b-3cf5872d5522
📥 Commits

Reviewing files that changed from the base of the PR and between 8f92b06 and 998777d.

📒 Files selected for processing: 1
  • .github/workflows/CI.yml

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

The README and iter_rows() docstring now describe how iteration handles leading empty rows and columns. The CI workflow selects Ubuntu 24.04 for Linux runners.

Changes: Iterator behavior documentation

Layer / File(s) Summary
Document iterator offsets
README.md, python/python_calamine/_python_calamine.pyi
The documentation states that iter_rows() includes leading empty rows but omits columns before the used range. It describes the column offset from sheet.start and identifies to_python(skip_empty_area=False) as the option to retain both offsets.

CI runner updates

Layer / File(s) Summary
Select Ubuntu 24.04 runners
.github/workflows/CI.yml
CI jobs use Ubuntu 24.04 for Linux runners. Explicit matrix runner values take precedence, and non-Linux jobs retain their operating system’s -latest runner.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other · Severity of issue fixed: Low

Suggested reviewers: dimastbk

Merge Risk: ⚪ Minimal · up to 99877

The documentation accurately describes sparse-sheet offsets, and no actionable merge risk is established by the supplied runner changes.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Out of Scope Changes check Warning The workflow changes replace ubuntu-latest with ubuntu-24.04 and change runner fallback selection. These changes do not implement or support the documentation requirement in issue #177. Remove the unrelated .github/workflows/CI.yml changes from this pull request, or link them to a separate issue and submit them separately.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Issue #177 permits documentation clarification. README.md and CalamineSheet.iter_rows documentation explain the leading row and column offsets, the C3/D3 example, and the difference from `to_p…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. (1 skipped: 1 …
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: documentation that clarifies column offsets for the row iterator.
Full details: Linked Issues check

Explanation

Issue #177 permits documentation clarification. README.md and CalamineSheet.iter_rows documentation explain the leading row and column offsets, the C3/D3 example, and the difference from to_python(skip_empty_area=False). The reported checks support the documented behavior.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit reads the rows with care
And notes which columns start elsewhere
The README tells the offsets right
Ubuntu runners join the flight
The carrots wait; the checks are green
A tidy patch for sheets unseen

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

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.

CalamineCellIterator always starts from row 0

2 participants