Skip to content

Commit

Permalink
fix: if first whole TBasket has inconclusive AwkwardForth (#1280)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpivarski authored Aug 27, 2024
1 parent 448f20e commit 12b473b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/uproot/interpretation/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,27 @@ def final_array(

start = stop

# If *some* of the baskets are Awkward and *some* are not,
# convert the ones that are not, individually.
if any(
uproot._util.from_module(x, "awkward") for x in basket_arrays.values()
) and isinstance(
library,
(
uproot.interpretation.library.Awkward,
uproot.interpretation.library.Pandas,
),
):
awkward = uproot.extras.awkward()
for k, v in basket_arrays.items():
if not uproot._util.from_module(v, "awkward"):
form = json.loads(self.awkward_form(branch.file).to_json())
basket_arrays[k] = (
uproot.interpretation.library._object_to_awkward_array(
awkward, form, v
)
)

if len(basket_arrays) == 0:
output = numpy.array([], dtype=self.numpy_dtype)

Expand Down

0 comments on commit 12b473b

Please sign in to comment.