Commits


Krisztián Szűcs authored and Wes McKinney committed 973d6466d5a
ARROW-9272: [C++][Python] Reduce complexity in python to arrow conversion The original motivation for this patch was to reuse the same conversions path for both the scalars and arrays. In my recent patch the scalars are converted from a single element list to a single element array then copied out from it. On the long term we should convert them directly, perhaps with a more generic converter API, until that this patch aims to reduce code complexity without introducing any regressions. I checked the produced binary size: ```console # BEFORE -rwxr-xr-x 1 kszucs staff 2926832 Jun 29 23:07 libarrow_python.100.0.0.dylib # AFTER -rwxr-xr-x 1 kszucs staff 2869136 Jun 29 23:06 libarrow_python.100.0.0.dylib ``` ``` convert_builtins.ConvertPyListToArray.time_convert ==================== ========= ======== type before after -------------------- --------- -------- int32 129±0ms 135±0m uint32 139±0ms 134±0m int64 132±0ms 139±0m uint64 135±0ms 132±0m float32 149±0ms 131±0m float64 143±0ms 141±0m bool 126±0ms 130±0m decimal 139±0ms 135±0m binary 145±0ms 130±0m binary10 136±0ms 130±0m ascii 145±0ms 136±0m unicode 148±0ms 149±0m int64 list 174±0ms 176±0m struct 164±0ms 177±0m struct from tuples 165±0ms 169±0m ==================== ========= ======== convert_builtins.InferPyListToArray.time_infer ============ ========= ======== type before after ------------ --------- -------- int64 157±0ms 158±0m float64 155±0ms 153±0m bool 155±0ms 154±0m decimal 249±0ms 233±0m binary 167±0ms 162±0m ascii 181±0ms 154±0m unicode 179±0ms 171±0m int64 list 188±0ms 192±0m struct 177±0ms 181±0m ============ ========= ======== ``` I'm still running the benchmarks to prevent any performance regressions. Closes #7584 from kszucs/py2arrow Lead-authored-by: Krisztián Szűcs <szucs.krisztian@gmail.com> Co-authored-by: Wes McKinney <wesm@apache.org> Signed-off-by: Wes McKinney <wesm@apache.org>