Repository navigation
Do not fill an absent named link with links of a matching type - #1598
Open
bendichter wants to merge 2 commits into
Open
bendichter wants to merge 2 commits into
bendichter wants to merge 2 commits into
Conversation
On read, a link spec with a name that is absent from the file fell through to matching the group's links by target type. Since subtypes match (#1481), an optional link whose target_type is a common base type received a list of every link in the group, and construction failed. Match links by type only for unnamed link specs. Fix #1595 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1598 +/- ##
==========================================
- Coverage 93.17% 93.16% -0.01%
==========================================
Files 41 41
Lines 10304 10305 +1
Branches 2132 2133 +1
==========================================
Hits 9601 9601
Misses 423 423
- Partials 280 281 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
Motivation
Fix #1595.
On read,
ObjectMapper.__get_subspec_valuesassigns a named link from the group's link of that name. If the file has no link with that name, theelsebranch also ran for named specs and matched the group's other links bytarget_type. Since #1481, subtypes match too, so an optional named link whose target type is a common base type got every other link in the group as a list. Construction then failed.DANDI dandiset 001878 hits this. Its
EthogramBouts(ndx-ethogram) declares optional linkssource(targetNWBDataInterface),source_pose,source_video,observation_intervalsandethogram. The file sets all of them exceptsource:This PR matches links by type only for unnamed link specs (
else:→elif subspec.name is None:). A named link that's absent from the file is left unset.How to test the behavior?
The new test fails on
dev(sourceis set to theotherlink's target) and passes with this change. The full unit suite shows no new failures. The DANDI file (https://dandiarchive.s3.amazonaws.com/blobs/eaa/b5c/eaab5c37-7a7f-4b65-864d-f2986df5d64e) reads with pynwb 4.2.0 on this branch.Checklist
CHANGELOG.mdwith your changes?🤖 Generated with Claude Code