Repository navigation
Keep keys without a normalizer in array shapes - #241
Merged
Merged
Conversation
ArrayShapeNormalizer only returned the keys it had an inner normalizer for, so every other key of the shape was silently dropped on extract and hydrate. Keys holding null were dropped too because of isset(). The normalizer now works on the given array and only converts the keys it has a normalizer for, null included, and keeps everything else as it is, like ArrayNormalizer and plain arrays do.
|
Hello 👋 Here are the most recent benchmark results, compared against StackHydrator
StackHydratorWithCryptography
StackHydratorWithLazy
This comment gets updated every time a new commit comes in. |
DanielBadura
approved these changes
Nov 6, 2026
This was referenced Nov 6, 2026
Merged
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.
ArrayShapeNormalizeronly kept the keys that had an inner normalizer, and because ofisset()it also dropped keys holdingnull. Forarray{height: int, addresses: list<Address>}theheightwas lost on extract and on hydrate. Now the normalizer converts the keys that have a normalizer and keeps everything else as it is.What a caller can notice: inner normalizers now get
nullfor a key that holdsnull, like normalizers of top level properties and ofArrayNormalizeritems already do, so a normalizer that is not null safe will throw there now. Keys without a normalizer, also ones that are not part of the shape, are kept raw on both sides, and the output follows the order of the input array. Data that was written before the fix is still missing the dropped keys.Found while moving patchlevel/odm to hydrator 2 (patchlevel/odm#29).