Skip to content

Commit

Permalink
fix: catch specific option case instead of packing layout
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Jan 10, 2023
1 parent 18415a1 commit 6cd9cc3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/awkward/operations/ak_unflatten.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ def _impl(array, counts, axis, highlevel, behavior):
if isinstance(counts, (numbers.Integral, np.integer)):
current_offsets = None
else:
counts = ak.operations.to_layout(
counts, allow_record=False, allow_other=False
).to_packed()
counts = ak.operations.to_layout(counts, allow_record=False, allow_other=False)
if counts.is_indexed and not counts.is_option:
counts = counts.project()

if counts.is_option and (counts.content.is_numpy or counts.content.is_unknown):
mask = counts.mask_as_bool(valid_when=False)
counts = backend.nplike.to_rectilinear(
Expand Down

0 comments on commit 6cd9cc3

Please sign in to comment.