Skip to content

Fix split.dictionary defaults for invalid inputs and null values - #1224

Merged
ebhills merged 1 commit into
mainfrom
codex/split-dictionary-defaults
Oct 9, 2026
Merged

ebhills merged 1 commit into
mainfrom
codex/split-dictionary-defaults

Conversation

@ebhills

@ebhills ebhills commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Linked issue

Closes #1223

What changes

A split.dictionary step with an explicit default now handles non-dictionary inputs such as Timed Out and applies per-key defaults to null values. With default: {Voltage: {}}, both a missing Voltage key and {"Voltage": null} produce {}; existing Voltage objects remain intact.

Invalid input cells are treated as empty dictionaries only when a default is supplied, including default: {}. Multiple input columns retain their existing precedence, then missing/null keys receive their defaults. The behavior applies to both columns and to_lists, with independent copies of mutable defaults. Schema descriptions explain the fallback, case sensitivity, preserved non-null values, and output-format handling.

Scope: one commit, limited to wrangles/recipe_wrangles/split.py and its existing test file.

How it was verified

  • Full credential-free suite: scripts/test-local.ps1 — 2,821 passed, 6 skipped, 139 deselected.
  • Focused offline run using pytest-local.ini: the complete split test file plus the wrangle schema-docstring check — 133 passed. Credentials were removed and networking was disabled.
  • Generated the recipe schema in a temporary directory and validated it as Draft 7. Three representative recipes passed; three invalid default shapes were rejected.
  • git diff --check passed.
  • Regression coverage includes the JSON-to-Voltage recipe, invalid inputs with and without defaults, empty/invalid defaults, multi-input precedence, valid falsy values, case-sensitive keys, renaming/filtering, both output formats, and mutable-default isolation.
  • No live Excel or Wrangles-service execution was performed. GitHub CI is pending.

Compatibility and risk

Existing recipes that supply defaults intentionally change behavior for invalid input cells and null-valued keys. Recipes without defaults remain strict for invalid inputs. Non-null values, including zero, false, empty strings, lists, and dictionaries, are preserved; defaults do not recursively merge nested objects.

No public parameters or dependencies change. The updated Python package must be deployed to execute-recipes-dev after merge before WranglesXL development uses this behavior. Rollback is to revert this commit and redeploy the previous package.

Ready-for-review checklist

  • One human delivery owner is assigned — ebhills
  • The linked issue and intended milestone are correct — Apply split.dictionary defaults to invalid inputs and null values #1223; no release milestone specified
  • The branch is current with main and has no merge conflicts
  • Focused tests pass
  • New or changed behavior has direct test coverage
  • Documentation/schema/configuration is updated where applicable
  • The PR contains no unrelated changes
  • The PR description reflects the branch's current scope and latest validation
  • One primary reviewer is requested only when this PR is ready

See the pull request workflow.

@ebhills ebhills self-assigned this Oct 9, 2026
@ebhills
ebhills requested a lite review from Copilot October 9, 2026 23:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved review issues were identified, and all approval-readiness assessments recommend approval.

0 open findings

What changed in this PR

Updates split.dictionary to apply defaults for invalid inputs and null values while preserving valid values and input precedence.

Changes:

  • Adds fallback handling for invalid inputs when defaults are supplied.
  • Applies per-key defaults to missing and null values.
  • Expands schema documentation and regression tests for both output formats.
File Description
wrangles/​recipe_wrangles/​split.py Implements fallback handling and updated schema documentation.
tests/​recipes/​wrangles/​test_split.py Adds comprehensive regression coverage.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ebhills
ebhills marked this pull request as ready for review October 9, 2026 23:46
@ebhills
ebhills merged commit 4ddeceb into main Oct 9, 2026
19 checks passed
@ebhills
ebhills deleted the codex/split-dictionary-defaults branch October 9, 2026 23:46
@ebhills ebhills mentioned this pull request Oct 11, 2026
16 of 40 tasks
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.

Apply split.dictionary defaults to invalid inputs and null values

2 participants