Skip to content

[Python] Conversion from custom types (eg decimal) to int dtype raises warning #18326

@asfimport

Description

@asfimport
In [2]: import decimal

In [3]: pa.array([decimal.Decimal("123456")], pa.int32())
DeprecationWarning: an integer is required (got type decimal.Decimal).  Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.

Out[3]: 
<pyarrow.lib.Int32Array object at 0x7f4432032b80>
[
  123456,
]

cc @kszucs

Reporter: Joris Van den Bossche / @jorisvandenbossche

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

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