Skip to content

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

Closed

Description

@asfimport
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.

 

Reporter: A. Coady / @coady

Related issues:

Note: This issue was originally created as ARROW-18432. Please see the migration documentation for further details.

Activity

  1. asfimport commented on Dec 12, 2022

    @asfimport
    Author

    Alenka Frim / @AlenkaF:
    This topic is not new and was already discussed/is tracked here: https://issues.apache.org/jira/browse/ARROW-5295

    Will close this and ask to move the questions/discussion to the other issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions