refactor: propagate attrs & behavior with dict-like ak.Array
input data
#3374
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.
Currently
ak.Array
(withdict
input data) andak.zip
differ in the following ways:ak.zip
does broadcasting,ak.Array
does not (it errors instead)ak.zip
does propagateattrs
andbehavior
from all (nested) arrays in the given dictionary,ak.Array
does notFor
1.
this PR improves the error message forak.Array
if it encounters different length inputs to give a hint to tryak.zip
instead (if broadcasting is a suitable solution).The second difference does not exist anymore with this PR,
ak.Array
will now also propagateattrs
andbehavior
in the same wayak.zip
does. I think it is a bit unintuitive thatak.zip
andak.Array
currently behave different for propagatingattrs
andbehavior
.I'll add a
policy
label, because it might be good to hear some input/feedback from @ianna, @jpivarski and @agoose77 about this change.(Closes: #3346)