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

[Python] Array.to_numpy() with type fixed_size_list(int64(), 1) doesn't roundtrip for large integer values

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Python

    Description

      Reproducer:

      data = [None, [9007199254740993]]
      arr = pa.array(data, type=pa.list_(pa.uint64(), 1))
      ndarray = arr.to_numpy(zero_copy_only=False)
      restored = pa.array(ndarray, type=arr.type)
      assert restored.equals(arr)
      

      Error:

      E       assert False
      E        +  where False = <built-in method equals of pyarrow.lib.FixedSizeListArray object at 0x7fbdb0239e20>(<pyarrow.lib.FixedSizeListArray object at 0x7fbdb0262220>\n[\n  null,\n  [\n    9007199254740993\n  ]\n])
      E        +    where <built-in method equals of pyarrow.lib.FixedSizeListArray object at 0x7fbdb0239e20> = <pyarrow.lib.FixedSizeListArray object at 0x7fbdb0239e20>\n[\n  null,\n  [\n    9007199254740992\n  ]\n].equals
      

      The inner numpy array (ndarray[1]) has float64 dtype where the integer gets truncated because of the precision.

      Attachments

        Activity

          People

            Unassigned Unassigned
            kszucs Krisztian Szucs
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: