Skip to content

Commit

Permalink
Allow old pyarrow to forget that an unnullable string has unnullable …
Browse files Browse the repository at this point in the history
…outputs.
  • Loading branch information
jpivarski committed Aug 15, 2023
1 parent 7ebf8ff commit dfa5d06
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/awkward/operations/str/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ def action(layout, **absorb):
),
highlevel=False,
)

if out.is_option:
out = out.content
if out.is_list and out.parameter("__array__") == "string":
out = out.copy(
content=out.content.copy(parameters={"__array__": "byte"}),
Expand All @@ -140,6 +143,9 @@ def action(layout, **absorb):
def _erase_list_option(layout):
from awkward.contents.unmaskedarray import UnmaskedArray

if layout.is_option:
layout = layout.content

assert layout.is_list
if layout.content.is_option:
assert isinstance(layout.content, UnmaskedArray)
Expand Down

0 comments on commit dfa5d06

Please sign in to comment.