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

[Python] Error when converting from list of uint64 arrays

    XMLWordPrintableJSON

Details

    Description

      >>> pa.array(np.uint64([0,1,2]), type=pa.uint64())
      <pyarrow.lib.UInt64Array object at 0x7f0e6c1eab88>
      [
        0,
        1,
        2
      ]
      >>> pa.array([np.uint64([0,1,2])], type=pa.list_(pa.uint64()))
      Traceback (most recent call last):
        File "<ipython-input-70-1b103d3e4574>", line 1, in <module>
          pa.array([np.uint64([0,1,2])], type=pa.list_(pa.uint64()))
        File "array.pxi", line 181, in pyarrow.lib.array
        File "array.pxi", line 36, in pyarrow.lib._sequence_to_array
        File "error.pxi", line 98, in pyarrow.lib.check_status
      ArrowException: Unknown error: /home/antoine/arrow/cpp/src/arrow/python/builtin_convert.cc:979 code: AppendPySequence(seq, size, real_type, builder.get())
      /home/antoine/arrow/cpp/src/arrow/python/builtin_convert.cc:402 code: static_cast<Derived*>(this)->AppendSingle(ref.obj())
      /home/antoine/arrow/cpp/src/arrow/python/builtin_convert.cc:402 code: static_cast<Derived*>(this)->AppendSingle(ref.obj())
      /home/antoine/arrow/cpp/src/arrow/python/builtin_convert.cc:542 code: CheckPyError()
      an integer is required
      

      More simply, it also fails with a sequence of Numpy uint64 scalars:

      >>> pa.array([np.uint64(1)], type=pa.uint64())
      Traceback (most recent call last):
        File "<ipython-input-71-679cb6c34137>", line 1, in <module>
          pa.array([np.uint64(1)], type=pa.uint64())
        File "array.pxi", line 181, in pyarrow.lib.array
        File "array.pxi", line 36, in pyarrow.lib._sequence_to_array
        File "error.pxi", line 98, in pyarrow.lib.check_status
      ArrowException: Unknown error: /home/antoine/arrow/cpp/src/arrow/python/builtin_convert.cc:979 code: AppendPySequence(seq, size, real_type, builder.get())
      /home/antoine/arrow/cpp/src/arrow/python/builtin_convert.cc:402 code: static_cast<Derived*>(this)->AppendSingle(ref.obj())
      /home/antoine/arrow/cpp/src/arrow/python/builtin_convert.cc:542 code: CheckPyError()
      an integer is required
      

      Attachments

        Issue Links

          Activity

            People

              apitrou Antoine Pitrou
              apitrou Antoine Pitrou
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: