Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-15202

[Python] Create pyarrow array using an object's `__array__` method.

Log workAgile BoardRank to TopRank to BottomAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsAdd voteVotersWatch issueWatchersCreate sub-taskConvert to sub-taskLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 6.0.1
    • None
    • Python
    • None

    Description

      `pa.array` supports optimized creation from an object with the `_arrow_array` method, or from a literal NumPy ndarray. But there's a performance gap if the input object has only an `array_` method, as it isn't used.
       
      So the user has to know to call `np.asarray` first. And even if the original object could be extended to support '_arrow_array_`, it doesn't seems like a great workaround if all that method would do is call `pa.array(np.asarray(self))`.

       

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned Assign to me
            coady A. Coady

            Dates

              Created:
              Updated:

              Slack

                Issue deployment