You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "kylebarron (via GitHub)" <gi...@apache.org> on 2024/09/25 21:19:20 UTC

[I] Allow PyCapsule Interface in `pyarrow.scalar` constructor? [arrow]

kylebarron opened a new issue, #44232:
URL: https://github.com/apache/arrow/issues/44232

   ### Describe the enhancement requested
   
   Should the `pyarrow.scalar` constructor check for the PyCapsule Interface? It would allow any input with `__arrow_c_array__`, additionally validating that the input is a length-1 array.
   
   In this case it's less important for the _speed_ of sharing large data across multiple libraries than it is for the reliability of communicating Arrow data.
   
   An existing workaround is to use `pa.array(other_scalar).slice(0, 1)`, so it's not clear whether the `pa.scalar` constructor should or should not check for this.
   
   cc @jorisvandenbossche 
   
   ### 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] Allow PyCapsule Interface in `pyarrow.scalar` constructor? [arrow]

Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on issue #44232:
URL: https://github.com/apache/arrow/issues/44232#issuecomment-2697395188

   Thank you for opening up the issue, @kylebarron!
   
   I think allowing and checking for 1-length objects implementing `__arrow_c_array__` in `pyarrow.scalar` is a good idea and should be fairly straightforward to implement. However, I'm a bit confused about the workaround you're referring to. Could you provide more context or a reproducible example of the workaround? This would help me better understand the use case.


-- 
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] Allow PyCapsule Interface in `pyarrow.scalar` constructor? [arrow]

Posted by "Lukedowling444 (via GitHub)" <gi...@apache.org>.
Lukedowling444 commented on issue #44232:
URL: https://github.com/apache/arrow/issues/44232#issuecomment-2408505795

   /take


-- 
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] Allow PyCapsule Interface in `pyarrow.scalar` constructor? [arrow]

Posted by "Lukedowling444 (via GitHub)" <gi...@apache.org>.
Lukedowling444 commented on issue #44232:
URL: https://github.com/apache/arrow/issues/44232#issuecomment-2408530719

   take


-- 
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] Allow PyCapsule Interface in `pyarrow.scalar` constructor? [arrow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #44232:
URL: https://github.com/apache/arrow/issues/44232#issuecomment-4387610070

   This issue has been marked as stale because it has had no activity in the past 365 days. Please remove the stale label or comment below, or this issue will be closed in 14 days. If this improvement is still desired but has no current owner, please add the 'Status: needs champion' label.


-- 
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] Allow PyCapsule Interface in `pyarrow.scalar` constructor? [arrow]

Posted by "Lukedowling444 (via GitHub)" <gi...@apache.org>.
Lukedowling444 commented on issue #44232:
URL: https://github.com/apache/arrow/issues/44232#issuecomment-2401691576

   take
   


-- 
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] Allow PyCapsule Interface in `pyarrow.scalar` constructor? [arrow]

Posted by "kylebarron (via GitHub)" <gi...@apache.org>.
kylebarron commented on issue #44232:
URL: https://github.com/apache/arrow/issues/44232#issuecomment-2697808659

   > However, I'm a bit confused about the workaround you're referring to. 
   
   Oh I had a typo in my original code. I meant `pyarrow.array(external_scalar)[0]`.
   
   So that uses the implementation of reading `__arrow_c_array__` from the `pyarrow.array` constructor, and then selects the first scalar.


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