Skip to content

Conversation

@fangchenli
Copy link
Member

No description provided.

…eger types

When converting ArrowExtensionArray to string dtype, use PyArrow's native
pc.cast() for integer and string types where the string representation
matches Python's str(). This avoids unnecessary conversion through NumPy.

Float and boolean types still fall back to lib.ensure_string_array because
PyArrow's string representation differs from Python's str():
- Float: 1.0 -> "1" (PyArrow) vs "1.0" (Python)
- Bool: True -> "true" (PyArrow) vs "True" (Python)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@fangchenli fangchenli added Arrow pyarrow functionality Performance Memory or execution speed performance labels Dec 17, 2025
Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@fangchenli fangchenli marked this pull request as ready for review December 18, 2025 18:16
fangchenli and others added 2 commits December 18, 2025 18:41
When using_infer_string is False, string columns start as object dtype
and get converted to Arrow, so memory is not shared.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arrow pyarrow functionality Performance Memory or execution speed performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants