feat(metadata): recursively unnest data inside extracted array elements#86
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 395e7f7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Array-of-objects columns were extracted only one level deep, so an element field that was itself an object (pointData.point) or an array (pointData.gazeSamples) was kept as a single opaque JSON column. accumulateArrayColumn now recurses (expandElementFields): a nested plain object is expanded into deeper dotted columns in the same sidecar row (pointData.point.x); a nested array-of-objects is extracted into its own grandchild CSV, joinable to its specific parent element via a qualified `<column>.element_index` key carried with the existing join keys. Every key/column is registered in variableMeasured. Verified with psychds-validator: full eye-tracking dataset (38 files) via the real CLI binary produces grandchild gazeSamples tables and validates with 0 errors; event-boundary still 0 errors. Full suite 206/206. Note: arrays of primitives are still recorded as a single value:"array" column (no per-element breakdown) — tracked as a separate follow-up. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
afc4db8 to
395e7f7
Compare
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.
Stacked on #84 (base =
fix/array-element-fields-variablemeasured; will retarget tomainonce #84 merges).Problem
Array-of-objects columns were extracted only one level deep, so an element field that was itself an object (
validation_data.pointData.point) or an array (validation_data.pointData.gazeSamples) stayed an opaque JSON column.Fix
accumulateArrayColumnnow recurses viaexpandElementFields:pointData.point.x,pointData.point.y).<column>.element_indexkey carried alongside the existing join keys (e.g.trial_index+validation_data.pointData.element_index+ the grandchild's ownelement_index).variableMeasured; scalars keep type + min/max/levels tracking. Composes to arbitrary depth.Verification
...GazeSamplesgrandchild tables and validates with 0 errors; event-boundary still 0 errors.Out of scope (separate follow-up)
Arrays of primitives (
block_order:[16,100,4,1],images:[…]) are still recorded as a singlevalue:"array"column with no per-element breakdown (issue #72 §3). Handled next, on its own branch.🤖 Generated with Claude Code