Skip to content

[Python] OverflowError when inferring large unsigned integers (uint64 not handled) #47607

@sanjay20m

Description

@sanjay20m

Describe the bug, including details regarding any error messages, version, and platform.

When converting Python integers to Arrow types, the current type inference
always defaults to int64. This causes an OverflowError when handling integers
greater than 2**63 - 1.

Example:
data = [0, np.iinfo(np.uint64).max]
pa.array(data) # raises OverflowError

Expected:
Inference should detect values that fit into uint64 and select that type
instead of failing.

A proposed fix tracks min/max integer values during inference and chooses the
smallest fitting signed/unsigned integer type.

pr link: #47604

Component(s)

Python

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions