Repository navigation
Fix split.dictionary defaults for invalid inputs and null values - #1224
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 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.
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.
Linked issue
Closes #1223
What changes
A
split.dictionarystep with an explicit default now handles non-dictionary inputs such asTimed Outand applies per-key defaults to null values. Withdefault: {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 bothcolumnsandto_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.pyand its existing test file.How it was verified
scripts/test-local.ps1— 2,821 passed, 6 skipped, 139 deselected.pytest-local.ini: the complete split test file plus the wrangle schema-docstring check — 133 passed. Credentials were removed and networking was disabled.git diff --checkpassed.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-devafter merge before WranglesXL development uses this behavior. Rollback is to revert this commit and redeploy the previous package.Ready-for-review checklist
mainand has no merge conflictsSee the pull request workflow.