Skip to content

fix: correctly calculate max visible level when a list has no def#6008

Merged
westonpace merged 2 commits intolance-format:mainfrom
westonpace:fix/list-struct-nulls-panic
Feb 25, 2026
Merged

fix: correctly calculate max visible level when a list has no def#6008
westonpace merged 2 commits intolance-format:mainfrom
westonpace:fix/list-struct-nulls-panic

Conversation

@westonpace
Copy link
Copy Markdown
Member

@westonpace westonpace commented Feb 25, 2026

This was a bug that would be encountered whenever a list had nullable items (struct or otherwise) but the list itself was never null and never empty. The unraveler was incorrectly skipping offsets and returning fewer lists than it should.

This was a reader-only bug. No corrupt data would have been written.

Closes #5930

@github-actions github-actions Bot added bug Something isn't working python labels Feb 25, 2026
@westonpace
Copy link
Copy Markdown
Member Author

For review, probably just look at the test cases and ensure they make sense.

@github-actions
Copy link
Copy Markdown
Contributor

Code Review

P0: Debug print statement left in code

There is a println!("A: {:#?}", offsets); on line 1299 of rust/lance-encoding/src/repdef.rs that appears to be leftover debug output. This should be removed before merging.


The fix itself (adding .max(valid_level) to ensure the maximum visible level correctly accounts for valid levels when a list has no null/empty definitions) looks correct and is well-tested with both unit tests and an integration test.

@Xuanwo
Copy link
Copy Markdown
Collaborator

Xuanwo commented Feb 25, 2026

Thank you for working on this!

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@westonpace westonpace merged commit 098e59f into lance-format:main Feb 25, 2026
29 checks passed
wjones127 pushed a commit to wjones127/lance that referenced this pull request Feb 25, 2026
…nce-format#6008)

This was a bug that would be encountered whenever a list had nullable
items (struct or otherwise) but the list itself was never null and never
empty. The unraveler was incorrectly skipping offsets and returning
fewer lists than it should.

This was a reader-only bug.  No corrupt data would have been written.

Closes lance-format#5930
wjones127 pushed a commit to wjones127/lance that referenced this pull request Feb 25, 2026
…nce-format#6008)

This was a bug that would be encountered whenever a list had nullable
items (struct or otherwise) but the list itself was never null and never
empty. The unraveler was incorrectly skipping offsets and returning
fewer lists than it should.

This was a reader-only bug.  No corrupt data would have been written.

Closes lance-format#5930
wjones127 pushed a commit that referenced this pull request Feb 26, 2026
)

This was a bug that would be encountered whenever a list had nullable
items (struct or otherwise) but the list itself was never null and never
empty. The unraveler was incorrectly skipping offsets and returning
fewer lists than it should.

This was a reader-only bug.  No corrupt data would have been written.

Closes #5930
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lance 2.1/2.2 panics on null struct elements in List<Struct>

2 participants