fix: don't require Form JSON to have 'parameters' #1245
Merged
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.
Maybe this
form
is specially constructed to always have a"parameters"
key, but the general protocol for Awkward Form JSON doesn't require it. Thus, this PR replaces every attempt to extractform["parameters"]
withform.get("parameters", {})
. All of these cases are in the object → Awkward conversion that only runs if AwkwardForth failed to run. (It's the Uproot 4.x code, left in as a fallback if the much faster Uproot 5.x workflow doesn't work.)The fundamental cause of #1244 might be inconsistent construction of that
form
(a corner case that fails to add the"parameters"
key), and rather than fixing that at the producer end, this PR fixes it on the consumer end.