Repository navigation
Stream rows from a worksheet that prefixes its elements - #11
Merged
Merged
Conversation
streamRows looked for a literal <sheetData, so a part written as <x:sheetData> (the form the eager reader learned in 2.28.0) yielded no rows at all while excel['Sheet1'] read the same cells fine. The tag is now found with whatever prefix it carries; the cell walk already compared local names, and the part is still never parsed as a tree, so the memory profile of streaming is unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem. 2.28.0 taught the eager reader to read a part that prefixes
every element (
<x:sheetData>), butstreamRowsstill searched for aliteral
<sheetData, so for such a file it yields no rows whileexcel['Sheet1']reads the cells fine.streamRowsAsMapsinherits it.Fix. Locate
sheetDatathrough lazy XML events, then yield its rowsand stop at the closing event. Local-name matching handles prefixes, XML
comments cannot masquerade as tags, and legal closing-tag whitespace works.
No worksheet DOM or additional substring copy is created, so streaming
retains its memory bound. This avoids normalizing/re-serializing the worksheet.
Validation.
test/sheet_stream_test.dart, "Streaming Namespace Parity":a fully prefixed worksheet streams its cell, a prefixed empty
<x:sheetData/>yields no rows, legal closing-tag whitespace works, and acomment containing a prefixed tag does not hide the real data. The added
whitespace/comment cases fail on the initial fix and pass with the event
walk. Existing streaming and namespace suites pass.
🤖 Generated with Claude Code