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

[C++][Python] Segfault in StructArray.to_numpy and to_pandas if it contains an ExtensionArray

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 6.0.1
    • 8.0.0
    • C++, Python
    • pyarrow 6.0.1, macbook pro

    Description

      Hi !

      If you create a StructArray with an ExtensionArray in it, then both to_numpy and to_pandasĀ  segfault in python:

      import pyarrow as pa
      
      class CustomType(pa.PyExtensionType):
          def __init__(self):
              pa.PyExtensionType.__init__(self, pa.binary())
          def __reduce__(self):
              return CustomType, ()
      
      arr = pa.ExtensionArray.from_storage(CustomType(), pa.array([b"foo"]))
      pa.StructArray.from_arrays([arr], ["name"]).to_numpy(zero_copy_only=False)
       

      Thanks in advance for the help !

      Attachments

        Issue Links

          Activity

            People

              alenkaf Alenka Frim
              lhoestq quentin lhoest
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 40m
                  2h 40m