Skip to content

Commit

Permalink
fix: let form mappings apply a behavior (#834)
Browse files Browse the repository at this point in the history
* allow a behavior to be fed from a form_mapping

* update _get_meta_array
  • Loading branch information
lgray authored Mar 1, 2023
1 parent 43c9585 commit 4c1c807
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/uproot/_dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,8 +781,8 @@ def _get_meta_array(
if form_mapping is not None:
form = form_mapping(form)

empty_arr = awkward.from_buffers(
form, 0, {"": b"\x00\x00\x00\x00\x00\x00\x00\x00"}, buffer_key=""
empty_arr = form.length_zero_array(
behavior=None if form_mapping is None else form_mapping.behavior
)

return dask_awkward.core.typetracer_array(empty_arr), form
Expand Down Expand Up @@ -926,6 +926,7 @@ def foreach(start):
),
partition_args,
label="from-uproot",
behavior=None if form_mapping is None else form_mapping.behavior,
meta=meta,
)

Expand Down Expand Up @@ -980,5 +981,6 @@ def _get_dak_array_delay_open(
),
files,
label="from-uproot",
behavior=None if form_mapping is None else form_mapping.behavior,
meta=meta,
)

0 comments on commit 4c1c807

Please sign in to comment.