Repository navigation
Flag described unit class redeclarations - #1460
Merged
Merged
Conversation
An unmerged partnered library may name a partner unit class bare to add units to it. A redeclaration carrying a description was also taken for that form: it was left out of duplicate_names, so the merged schema held an empty second copy of the class and check_compliance reported nothing. The add-units form now also requires an empty description, so such a redeclaration is reported as SCHEMA_LIBRARY_INVALID like one with attributes (spec Appendix B, SCHEMA_LIBRARY_INVALID i). Fixes hed-standard#1434
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused fix correctly addresses the duplicate-detection gap and includes representative regression coverage.
0 open findings
What changed in this PR
Fixes partner unit-class redeclarations with descriptions being incorrectly treated as valid unit-only extensions.
Changes:
- Requires unit-class placeholders to have no description.
- Adds regression tests for bare, described, and attributed redeclarations.
| File | Description |
|---|---|
hed/schema/hed_schema_section.py |
Marks described unit-class redeclarations as duplicates. |
tests/schema/test_schema_merge.py |
Tests valid placeholders and invalid redeclarations. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
An unmerged partnered library may name a partner unit class bare to add units to it. A redeclaration carrying a description was also taken for that form: it was left out of duplicate_names, so the merged schema held an empty second copy of the class and check_compliance reported nothing. The add-units form now also requires an empty description, so such a redeclaration is reported as SCHEMA_LIBRARY_INVALID like one with attributes (spec Appendix B, SCHEMA_LIBRARY_INVALID i).
Fixes #1434