You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "AlenkaF (via GitHub)" <gi...@apache.org> on 2026/03/27 08:39:34 UTC
[I] [Python] Newly added & / | operators should work on boolean arrays/scalars [arrow]
AlenkaF opened a new issue, #49606:
URL: https://github.com/apache/arrow/issues/49606
### Describe the enhancement requested
Basic arithmetic on arrays and scalars has been added here: https://github.com/apache/arrow/pull/48085.
There has been a comment by @jorisvandenbossche that I forgot to make sure it is addressed:
> The & / | operators are currently mapped to the bitwise kernels, but in array-land, I think the most common use case for those is actually for logical (boolean) operations. So as a user, I would expect those to also work on bool type.
Link: https://github.com/apache/arrow/pull/48085#issuecomment-3654526351
I think it is worth looking into it as a follow up. I propose to:
- confirm that newly added `&` / `|` operators are not working on boolean arrays/scalars due to kernels only supporting integer types,
- think about using logical kernels ([`pc.and_`](https://arrow.apache.org/docs/python/generated/pyarrow.compute.and_.html)/[`pc.or_`](https://arrow.apache.org/docs/python/generated/pyarrow.compute.or_.html)) if the input is bool.
### Component(s)
Python
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Python] Newly added & / | operators should work on boolean arrays/scalars [arrow]
Posted by "rmnskb (via GitHub)" <gi...@apache.org>.
rmnskb commented on issue #49606:
URL: https://github.com/apache/arrow/issues/49606#issuecomment-4141041481
Hey, @AlenkaF !
If I remember correctly, the consensus was to let it be as is for the time being, and in case of any feature requests, we can switch to the other approach.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Python] Newly added & / | operators should work on boolean arrays/scalars [arrow]
Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on issue #49606:
URL: https://github.com/apache/arrow/issues/49606#issuecomment-4141084131
Could be! Or was that for the case of math-related dunders? (just opening an issue for that, so we have it tracked)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Python] Newly added & / | operators should work on boolean arrays/scalars [arrow]
Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on issue #49606:
URL: https://github.com/apache/arrow/issues/49606#issuecomment-4141094891
Aha, I see the later comment:
> We can keep the bitwise operators, remove the round/floor/etc. dunders, and perhaps improve things later if people request it.
which also deals with `&` / `|` operators, yes, correct.
Lets keep this open then, in case we might want to switch. I will update it so it reflects it might be something we work on in the future.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Python] Newly added & / | operators should work on boolean arrays/scalars [arrow]
Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on issue #49606:
URL: https://github.com/apache/arrow/issues/49606#issuecomment-4141026167
cc @rmnskb in case you are interested and have some spare time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org