Skip to content

PERF: avoid object-dtype path in ArrowEA._explode #61786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 7, 2025

Conversation

jbrockmendel
Copy link
Member

Identified in #61732

# pc.if_else here is similar to `values[mask] = fill_value`
# but this avoids an object-dtype round-trip.
pa_values = pc.if_else(~mask, values._pa_array, fill_value)
values = type(self)(pa_values)
counts = counts.copy()
Copy link
Member

Choose a reason for hiding this comment

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

Unrelated, but this need to be a copy (since it comes from a computed operation already)?

Copy link
Member Author

Choose a reason for hiding this comment

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

i dont see why it would. will remove it in my next "assorted cleanups" branch

@mroeschke mroeschke added the Arrow pyarrow functionality label Jul 7, 2025
@mroeschke mroeschke added this to the 3.0 milestone Jul 7, 2025
@mroeschke mroeschke merged commit d21ad1a into pandas-dev:main Jul 7, 2025
48 checks passed
@mroeschke
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the perf-explode branch July 7, 2025 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arrow pyarrow functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants