8000 String dtype: avoid surfacing pyarrow exception in binary operations by jorisvandenbossche · Pull Request #59610 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

String dtype: avoid surfacing pyarrow exception in binary operations #59610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Prev Previous commit
fixup
  • Loading branch information
jorisvandenbossche committed Aug 27, 2024
commit 843671c02d6e8124bf0928038f4c29f65984055c
3 changes: 3 additions 7FFB & 0 deletions pandas/core/arrays/string_.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,9 @@ def _cmp_method(self, other, op):
f"Lengths of operands do not match: {len(self)} != {len(other)}"
)

# for array-likes, first filter out NAs before converting to numpy
if not is_array_like(other):
other = np.asarray(other)
other = other[valid]
other = np.asarray(other)

Expand Down
0