Detect and expand JSON-serialized nested columns#46
Open
Mandyx22 wants to merge 3 commits into
Open
Conversation
Flat JSON objects (e.g. response: {Q0:4, Q1:3}) are now expanded into
dotted sub-variables (response.Q0, response.Q1) in variableMeasured with
correct types and min/max tracking. JSON arrays of objects are extracted
into separate Psych-DS compliant CSV files ({stem}_measure-{col}_data.csv)
with trial_index and element_index as join keys.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 75e37f9 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 |
…ation typeof never returns "array" so TypeScript rejected the assignment and comparison. Widening to string allows the custom "array" tag used to distinguish array-of-objects columns from plain objects. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Member
|
@Mandyx22 Can you show an example of what the final result looks like when there are nested tables? |
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.
Flat JSON object columns (e.g. response: {"Q0":4,"Q1":3}) are now expanded into dotted sub-variables (response.Q0, response.Q1) in variableMeasured, with correct types and min/max tracking. The parent variable is registered with value: "object" and no levels.
JSON array-of-objects columns (e.g. mouse_tracking_data: [{x,y,t},...]) are extracted into separate Psych-DS compliant CSV files named {stem}_measure-{col}_data.csv, with trial_index and element_index as join keys back to the parent file.
Both cases work from JSON and CSV input — CSV JSON strings are detected and parsed during the existing type coercion step.
Run npm test — all 30 tests pass including new metadata-nested-columns.test.ts
Run CLI against dev/ian-chat/OSF data.csv and confirm response sub-variables appear in dataset_description.json
Run CLI against dev/v8-data/mouse_extension/Mouse Extension.json and confirm a separate _measure-mouse-tracking-data_data.csv is created