AlenkaF commented on issue #34994:
URL: https://github.com/apache/arrow/issues/34994#issuecomment-6499446577

   I did some testing myself (can reproduce) and found that the most of the 
cost in the first repr comes from `pa.array` importing pandas. If pandas is 
already imported, the first call drops from ~200 ms to ~8 ms for me locally.
   
   The issue might be in `_is_array_like` importing pandas even for plain 
Python list:
   
   
https://github.com/apache/arrow/blob/a99464f9c625c3f85cade9d7d50eb25297ca1f8d/python/pyarrow/array.pxi#L62-L67
   
   Claude proposes a `sys.modules` check in `_is_array_like` before importing 
pandas. I haven't tested or looked into this idea but think it would be a good 
start.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to