Skip to content

Name MaxSynthesizedCells in the limit exception and document the limit - #1076

Open
vtxe02023274 wants to merge 1 commit into
mini-software:masterfrom
vtxe02023274:docs/max-synthesized-cells-limit
Open

vtxe02023274 wants to merge 1 commit into
mini-software:masterfrom
vtxe02023274:docs/max-synthesized-cells-limit

Conversation

@vtxe02023274

@vtxe02023274 vtxe02023274 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1075

The limit added in #1016 throws an exception that does not say which setting controls it, and it is not mentioned in the upgrade notes or the README.

  • The exception message now names OpenXmlConfiguration.MaxSynthesizedCells and says that null disables the limit.
  • The XML doc of MaxSynthesizedCells explains how cells are counted: each empty row counts as the number of columns being read (the header columns, or every column up to the last sheet column or endColumnIndex), and the limit does not apply with IgnoreEmptyRows.
  • V2-Upgrade-Notes.md lists the new limit and its default.
  • README.md gets a section 14 under Query with the QueryRange case from the issue and how to raise or disable the limit.

The new test uses the worksheet from the issue (values in A1 and A150, QueryRange up to column 1000): it checks that the default limit throws with the setting name in the message, that MaxSynthesizedCells = null returns all 150 rows, and that IgnoreEmptyRows returns the 2 rows without throwing. It fails on master because the message does not mention the setting.

dotnet test tests/MiniExcel.OpenXml.Tests passes on net8.0, net10.0 and net11.0 (566 tests), tests/MiniExcel.Csv.Tests passes on net10.0. I did not have a net9.0 runtime.

Summary by CodeRabbit

  • Documentation
    • Clarified how empty worksheet rows count toward the synthesized-cell limit, including how the number of columns read affects the count.
    • Documented that the default limit is 100,000 cells, and that it does not apply when empty rows are ignored.
  • Error Messages
    • When a query exceeds the limit, the error now explains that you can raise the limit or set it to null to disable it.

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The changes clarify synthesized-cell counting and configuration in documentation, name MaxSynthesizedCells in the limit exception message, and add tests for the default limit, disabling it, and ignoring empty rows. The limit check and exception type remain unchanged.

Changes: Synthesized-cell limit guidance

Layer / File(s) Summary
Document and verify synthesized-cell limit behavior
src/MiniExcel.OpenXml/OpenXmlConfiguration.cs, src/MiniExcel.OpenXml/Reader/OpenXmlReader.cs, tests/MiniExcel.OpenXml.Tests/Issues/MiniExcelGithubIssuesTests.cs, README.md, V2-Upgrade-Notes.md
The configuration documentation and user guides explain how synthesized cells are counted and how to adjust or disable the limit. The exception message names MaxSynthesizedCells. The test checks the default limit, disabling it, and IgnoreEmptyRows.

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

Change: Other · Severity of issue fixed: Medium

Suggested reviewers: shps951023, michelebastione

Merge Risk: Minimal · up to 68b0b

This change clarifies the synthesized-cell limit in the docs and names the controlling setting in the exception message. Runtime behavior is unchanged, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: the synthesized-cell limit exception now names the MaxSynthesizedCells setting, and the limit is documented. The raw summary confirms the exception message change in O…
Linked Issues check Passed Issue #1075 requires that the breaking default MaxSynthesizedCells limit be disclosed, that the exception identify the controlling setting, and that the docs explain how the budget scales with column …
Out of Scope Changes check Passed All changed areas connect to #1075:
- OpenXmlReader.cs: exception message text only. It names the controlling setting and the null option.
- OpenXmlConfiguration.cs: XML doc only. It explains the coun…
Full details: Title check

Explanation

The title names the main change: the synthesized-cell limit exception now names the MaxSynthesizedCells setting, and the limit is documented. The raw summary confirms the exception message change in OpenXmlReader.cs and the README and upgrade-note documentation. The title is specific and accurate, and it matches the linked issue's request to name the controlling setting and document the limit.

Full details: Linked Issues check

Explanation

Issue #1075 requires that the breaking default MaxSynthesizedCells limit be disclosed, that the exception identify the controlling setting, and that the docs explain how the budget scales with column width.

  • Exception message: OpenXmlReader.cs (InternalQueryRangeAsync) now appends "Increase OpenXmlConfiguration.MaxSynthesizedCells or set it to null to disable the limit." The setting name is built with nameof, so it stays accurate. This meets the issue's suggestion 2.
  • Scaling documentation: the XML doc on OpenXmlConfiguration.MaxSynthesizedCells explains per-column counting, and the README Query section (new section 14) gives the QueryRange example and how to raise or disable the limit. This meets the issue's suggestion 3.
  • Disclosure: V2-Upgrade-Notes.md lists the limit and its 100,000 default. The issue allows a documented breaking change in upgrade notes, so this satisfies the expected behavior.
  • Test: QueryRangeSynthesizedCellLimitNamesTheSettingAndCanBeDisabled uses the issue's A1/A150 case. It checks the exception text, MaxSynthesizedCells = null returning 150 rows, and IgnoreEmptyRows returning 2 rows.

Gap: the issue's suggestion 1 also names release notes (2.0.0 / 1.47.0). The PR does not change release notes. The issue's expected behavior accepts upgrade notes, so this does not fail the requirement. The diff does not show release-note content, so this is an observation only.

Full details: Out of Scope Changes check

Explanation

All changed areas connect to #1075:

  • OpenXmlReader.cs: exception message text only. It names the controlling setting and the null option.
  • OpenXmlConfiguration.cs: XML doc only. It explains the counting rule that the issue asks to document.
  • README.md and V2-Upgrade-Notes.md: documentation of the breaking limit, its default, and how to adjust it.
  • MiniExcelGithubIssuesTests.cs: one new test for the issue's reproduction and its expected messages and settings.

No behavior change to the limit or its default was found in the reviewed diff. No unrelated change was found.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
Fix failing CI checks

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 988d9485-9842-4e0e-bae4-bcb53cf43e21
Commits

Reviewing files that changed from the base of the PR and between 84b8340 and 68b0be9.

Files selected for processing: 5

  • README.md
  • V2-Upgrade-Notes.md
  • src/MiniExcel.OpenXml/OpenXmlConfiguration.cs
  • src/MiniExcel.OpenXml/Reader/OpenXmlReader.cs
  • tests/MiniExcel.OpenXml.Tests/Issues/MiniExcelGithubIssuesTests.cs

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

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.

[BUG] - MaxSynthesizedCells (default 100,000) is a breaking behavior change but is not listed in breaking changes / upgrade notes

1 participant