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

[Python] Array constructor doesn't support arrow scalars.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 10.0.1
    • None
    • Python
    • None

    Description

      pa.array([pa.scalar(0)])
      ArrowInvalid: Could not convert <pyarrow.Int64Scalar: 0> with type pyarrow.lib.Int64Scalar: did not recognize Python value type when inferring an Arrow data type
      
      pa.array([pa.scalar(0)], 'int64')
      ArrowInvalid: Could not convert <pyarrow.Int64Scalar: 0> with type pyarrow.lib.Int64Scalar: tried to convert to int64

      It seems odd that the array constructors don't recognize their own scalars.

      In practice, a list of scalars has to be converted with `.as_py()` just to be converted back, and that also loses the type information.

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              coady A. Coady
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: