did: fix CI failures from ndi-matlab#802 follow-up (doc2sql orientation, validator reverse lookup)#139
Merged
Conversation
Two follow-up fixes after #138 landed; surfaced by next ndi-matlab #802 CI run. 1. did.implementations.doc2sql line 54: vertcat dimension mismatch. My #138 fix used `[{dependsOn.name}; targets]` where `targets` came from arrayfun. arrayfun preserves the input's orientation, but `{struct.field}` always returns a row regardless of the struct array's shape. When dependsOn was a column struct array the two sides had different orientations and concatenation failed. Rewritten to a plain for-loop that fills a preallocated 2xN cell. Bulletproof regardless of dependsOn's orientation. 2. did.database/validate_doc_vs_schema line 1370: the per-subfield loop iterates the schema-declared subfield names. After my #138 field-set-tolerance accepted that the V_delta body uses reader_class instead of ndi_daqmetadatareader_class, the subfield loop then tried `docValue.(subfield)` with subfield = the schema name ('ndi_daqmetadatareader_class') which doesn't exist on the V_delta body. Added did.document.i_aliasV_alphaToV_delta(block, vAlphaName) which maps the schema's V_alpha name to the V_delta canonical so the body lookup succeeds. The forward map (i_normalizePropertyBlockFields) and the reverse helper now share a single source-of-truth table via the new i_propertyBlockRenameMap helper. The original error still fires on truly-missing fields.
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.
Follow-up to #138. Two regressions my #138 fixes introduced, surfaced by the next ndi-matlab #802 CI run:
1.
doc2sqlvertcat dimension mismatchMy #138 fix:
arrayfunpreserves the input struct array's orientation, but{struct.field}always returns a row regardless. WhendependsOnis a column struct array, the two have different orientations andvertcatfails withMATLAB:catenate:dimensionMismatch.Rewritten to a plain for-loop that fills a preallocated
2×Ncell. Orientation-independent.2. validator subfield-loop V_alpha lookup
My #138 field-set normalization accepts that the V_delta body uses
reader_classwhere the schema declaresndi_daqmetadatareader_class. The next loop (line ~1370) then iterates the schema's subfields and doesdocValue.(subfield)with the V_alpha name — which doesn't exist on the V_delta body.Added
did.document.i_aliasV_alphaToV_delta(block, vAlphaName). When the dot-access would fail, look up the V_delta canonical via the rename map and try that name instead. The original error still fires on truly missing fields.The forward map (
i_normalizePropertyBlockFields) and the reverse helper now share a single source-of-truth table via the newi_propertyBlockRenameMap().Coordination
ndi-matlab #802 needs a CI re-trigger once this lands. Pushing the matching
normalizeDependsOnempty-array fix on that side concurrently.Generated by Claude Code