Skip to content

Add join command for two arrays on a key (0.7.0) - #9

Merged
rmkr-dev merged 1 commit into
mainfrom
feat/join-command
Oct 12, 2026
Merged

rmkr-dev merged 1 commit into
mainfrom
feat/join-command

Conversation

@rmkr-dev

Copy link
Copy Markdown
Owner

Adds join KEY --with RIGHT_FILE [file], which joins two arrays of objects on a top-level key.

  • --how inner (default) keeps matched rows; --how left also keeps unmatched left rows unchanged
  • Output follows left-row order, with one row per right match
  • Left keys come first, right keys are added after; right wins on collisions and KEY appears once
  • Keys match using the same labels as group-by, so 1 and "1" line up (JSON against CSV works directly). Missing or null keys never match
  • Left side reads from a file or stdin; right side is always a file, with its format detected separately or forced via --right-from
  • Non-list roots and non-object items raise a clear error

join_rows is exported from the package. README has a new Join section, the command table entry, and the library examples (also adds the missing stats_rows there). Version bumped to 0.7.0.

Test plan

  • pytest — 91 → 109 tests (new tests/test_join.py: inner, left, multi-match, collisions, missing/null keys, empty lists, bad roots, CSV/YAML/NDJSON right files, CLI errors)
  • README examples run by hand

join KEY --with RIGHT_FILE [file] joins two lists of objects on a top-level
key. Supports inner (default) and left joins, keeps left-row order, emits
one row per right match, and lets right values win on key collisions.
Keys match with group-by labels so CSV strings line up with JSON numbers.

Adds join_rows to the library, CLI options --how and --right-from, tests,
README docs, and bumps the version to 0.7.0.
@rmkr-dev
rmkr-dev merged commit 57c49c7 into main Oct 12, 2026
2 checks passed
@rmkr-dev
rmkr-dev deleted the feat/join-command branch October 12, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant