feat: any Mapping assigned to a WritableDirectory is interpreted as a TTree or failure, no fall-through. #779
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.
This is a change in policy. Now when anyone does
it will always attempt to interpret the
{"key": value}
Mapping (any kind of Mapping) as a TTree. If anyvalue
cannot be interpreted as an array, it raises an error message that highlights the"key"
name.The old behavior was to give up on interpreting
{"key": value}
as a TTree, but keep open the possibility that it might be some other kind of writable data. In practice, there are no other types of writable data associated with Mapping, so the error message would be"unrecognized type cannot be written to a ROOT file: __dict__'"
.What's worse, this error message depended on the state of the environment: if
awkward
is not installed, then Uproot can't check non-NumPyvalue
to see if it might be interpretable as an Awkward Array (withak.from_iter
), so it failed with the above complaint about not recognizing the dict type, instead of saying thatawkward
needs to be pip-installed.