Skip to content

pyright type error when hinting pyarrow.compute functions as Callable[[ChunkedArray[Any]], ChunkedArray[Any]] #48677

@liamholmes31

Description

@liamholmes31

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

I’m seeing a pyright type-checking error when I try to treat a pyarrow.compute function (for example pc.sin) as a callable that takes a ChunkedArray and returns a ChunkedArray.

At runtime this works as expected, but pyright reports a type error.

Minimal example:

import pyarrow.compute as pc
from typing import Callable, Any
from pyarrow import ChunkedArray

f: Callable[[ChunkedArray[Any]], ChunkedArray[Any]] = pc.sin

Leads to pyright error:

Type of "pc.sin" is "Overload[...]" which cannot be assigned to
"Callable[[ChunkedArray[Any]], ChunkedArray[Any]]"
(reportArgumentType)

Environment
pyarrow: 22.0.0
pyarrow-stubs: 19.2
pyright: 1.1.407
Python: 3.12.12

Component(s)

Python

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