apache / arrow

Apache Arrow is a multi-language toolbox for accelerated data interchange and in-memory processing
https://arrow.apache.org/
Apache License 2.0
14.37k stars 3.49k forks source link

[Python][Docs] Clarify docstring of pyarrow.compute.scalar() #41985

Open jorisvandenbossche opened 4 months ago

jorisvandenbossche commented 4 months ago

The current docstring of pc.scalar is a bit lacking:

https://github.com/apache/arrow/blob/5a8644156f55254e5852f94533bb5578b04d7a25/python/pyarrow/compute.py#L718-L731

It says to only accept a subset of types, but in practice it accepts a pyarrow.Scalar or anything that can be passed to pa.scalar (function to create a pyarrow.Scalar).

It would also be good to clarify a bit more the difference with pa.scalar()

From https://lists.apache.org/thread/s34s2988k9s31y8c0rglfpg2q1zc32pm

davidleon123 commented 1 week ago

take