Skip to content

Commit

Permalink
feat: don't check masks by default
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Nov 1, 2023
1 parent a5c4f71 commit fb492c2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/awkward/operations/str/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
from awkward.operations.str.akstr_upper import *


def _drop_option_preserving_form(layout, ensure_trivial_mask: bool = True):
def _drop_option_preserving_form(layout, ensure_empty_mask: bool = False):
from awkward._do import recursively_apply
from awkward.contents import UnmaskedArray, IndexedOptionArray, IndexedArray

Expand All @@ -98,7 +98,7 @@ def action(_, continuation, **kwargs):
else:
index_nplike = this.backend.index_nplike
assert not (
ensure_trivial_mask
ensure_empty_mask
and index_nplike.known_data
and index_nplike.any(this.mask_as_bool(valid_when=False))
), "did not expect option type, but arrow returned a non-erasable option"
Expand All @@ -121,6 +121,7 @@ def _apply_through_arrow(
expect_option_type=False,
string_to32=False,
bytestring_to32=False,
ensure_empty_mask=False,
**kwargs,
):
from awkward._backends.dispatch import backend_of
Expand Down Expand Up @@ -171,7 +172,7 @@ def _apply_through_arrow(
if expect_option_type:
return out
else:
return _drop_option_preserving_form(out)
return _drop_option_preserving_form(out, ensure_empty_mask=ensure_empty_mask)


def _get_ufunc_action(
Expand Down

0 comments on commit fb492c2

Please sign in to comment.