Fix single-row compound datasets with references being flattened#338
Open
bendichter wants to merge 1 commit into
Open
Fix single-row compound datasets with references being flattened#338bendichter wants to merge 1 commit into
bendichter wants to merge 1 commit into
Conversation
Override shape property on AbstractZarrTableDataset to return None instead of the raw zarr array shape. This prevents hdmf's objectmapper from treating single-row compound datasets as scalars and unwrapping data[0] into a flat row [val1, val2, ref], which caused a column length mismatch error in DynamicTable construction. Fixes #337 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unified-zarr-convention #338 +/- ##
===========================================================
- Coverage 82.08% 82.04% -0.04%
===========================================================
Files 5 5
Lines 1423 1426 +3
Branches 298 298
===========================================================
+ Hits 1168 1170 +2
- Misses 168 169 +1
Partials 87 87 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
Override
shapeproperty onAbstractZarrTableDatasetto returnNoneinstead of the raw zarr array shape. This prevents hdmf'sobjectmapperfrom treating single-row compound datasets as scalars and unwrappingdata[0]into a flat row.Root cause
hdmf's
ObjectMapper.__get_subspec_valuesunwrapsbuilder.datawhenshape == (1,)anddata[0]is notnp.void. ForBuilderZarrTableDataset, this replaces the lazy wrapper with a flat row[val1, val2, GroupBuilder], causing a column length mismatch inDynamicTable.__init__.Fix
Return
Noneforshapeon compound table datasets so the scalar unwrap is never triggered.Test plan
Fixes #337
🤖 Generated with Claude Code