You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "bkietz (via GitHub)" <gi...@apache.org> on 2024/02/02 16:43:42 UTC
Re: [I] [Python] support for complex64 and complex128 as primitive types for zero-copy interop with numpy [arrow]
bkietz commented on issue #39753:
URL: https://github.com/apache/arrow/issues/39753#issuecomment-1924249433
FixedShapeTensor is a canonical extension type which [also uses `fixed_size_list` in its storage type](https://github.com/apache/arrow/blob/8bff1000e3c093a4b162c17cc04ca03949bb9e4b/cpp/src/arrow/extension/fixed_shape_tensor.h#L57). It was added in #8510, and mailing list [discussion](https://lists.apache.org/thread/oxvx0z0no2yyqsffzdc6nyjh6j4o6krs) and [vote](https://lists.apache.org/thread/f303yscj8gq4oggvvcbvf5zpo972l1kk) is archived.
As for numpy zero copy: we don't currently have a canonical extension type which maps to a numpy type like this one would. In order to support this, it'd be necessary to modify functions like [NumPyDtypeToArrow](https://github.com/apache/arrow/blob/8bff1000e3c093a4b162c17cc04ca03949bb9e4b/python/pyarrow/src/arrow/python/numpy_convert.cc#L133) which maps from a numpy type to an arrow DataType. That might be sufficient for `NumPyConverter::ConvertData` to [recognize zero-copy compatibility](https://github.com/apache/arrow/blob/8bff1000e3c093a4b162c17cc04ca03949bb9e4b/python/pyarrow/src/arrow/python/numpy_to_arrow.cc#L465-L470)
--
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