You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "westonpace (via GitHub)" <gi...@apache.org> on 2023/02/27 21:46:19 UTC

[GitHub] [arrow] westonpace commented on issue #34353: [Python] Add support for string + string add_checked

westonpace commented on issue #34353:
URL: https://github.com/apache/arrow/issues/34353#issuecomment-1447147451

   I think you can perhaps achieve this with the `binary_join_element_wise` kernel using an empty separator (admittedly, not intuitive):
   
   ```python
   import pyarrow as pa
   import pyarrow.compute as pc
   
   x = pa.array(['one', 'two', 'three'], pa.string())
   y = pa.array(['1', '2', '3'], pa.string())
   
   print(pc.binary_join_element_wise(x, y, '='))
   print(pc.binary_join_element_wise(x, y, ''))
   
   # [
   #   "one=1",
   #   "two=2",
   #   "three=3"
   # ]
   # [
   #   "one1",
   #   "two2",
   #   "three3"
   # ]
   ```
   
   It appears the current implementation is expecting the `add_checked` function to support strings but I think the decision in Arrow was that `add_checked` is an arithmetic operation and string concatenation is a different function entirely.  That shouldn't (to the best of my knowledge) prevent pandas from converting `string + string` to `binary_join_element_wise` however.


-- 
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