Skip to content

Commit

Permalink
[ArrowStringArray] PERF: small perf gain for object fallback (pandas-…
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjayhawkins authored May 6, 2021
1 parent ae5fe34 commit 4af3eed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pandas/core/arrays/string_arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,8 @@ def _str_map(self, f, na_value=None, dtype: Dtype | None = None):
result = lib.map_infer_mask(
arr, f, mask.view("uint8"), convert=False, na_value=na_value
)
return self._from_sequence(result)
result = pa.array(result, mask=mask, type=pa.string(), from_pandas=True)
return type(self)(result)
else:
# This is when the result type is object. We reach this when
# -> We know the result type is truly object (e.g. .encode returns bytes
Expand Down

0 comments on commit 4af3eed

Please sign in to comment.