Skip to content

Commit

Permalink
fix: lazily project union contents (#2913)
Browse files Browse the repository at this point in the history
* fix: lazily project union contents

* fix: use simplified
  • Loading branch information
agoose77 authored Dec 27, 2023
1 parent a9c2e3b commit 8612633
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/awkward/contents/unionarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ def project(self, index):
nextcarry = ak.index.Index64(
tmpcarry.data[: lenout[0]], nplike=self._backend.index_nplike
)
return self._contents[index]._carry(nextcarry, False)
return self._contents[index]._carry(nextcarry, True)

@staticmethod
def regular_index(
Expand Down
2 changes: 1 addition & 1 deletion src/awkward/operations/ak_enforce_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ def _recurse_union_non_union(

# Index over them
index = ak.index.Index64(index_data)
return ak.contents.IndexedArray(index, next_content)
return ak.contents.IndexedArray.simplified(index, next_content)
else:
# Find the first content whose type equals the given type
for tag, content in enumerate(layout.contents): # noqa: B007
Expand Down

0 comments on commit 8612633

Please sign in to comment.