Repository navigation
Closes #5426: apply to Series accessor - #5427
Merged
Merged
Conversation
ajpotts
force-pushed
the
5426_apply_to_Series_accessor
branch
from
February 20, 2026 23:48
350884c to
58f4f7e
Compare
ajpotts
force-pushed
the
5426_apply_to_Series_accessor
branch
2 times, most recently
from
February 24, 2026 15:55
5287c23 to
e89c17e
Compare
ajpotts
force-pushed
the
5426_apply_to_Series_accessor
branch
from
February 24, 2026 16:17
e89c17e to
286e1eb
Compare
ajpotts
marked this pull request as ready for review
February 24, 2026 17:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a new
applymethod on the Arkouda pandas Seriesaccessor (
Series.ak.apply).It enables element-wise application of Python callables or supported
lambda strings directly on Arkouda-backed numeric
pdarraydata withoutmaterializing to NumPy.
This integrates Arkouda's distributed
applyfunctionality into thepandas ExtensionArray API surface while preserving metadata (index and
name) and maintaining strict type discipline.
Key Changes
1.
Series.ak.applyImplementationAdded:
Behavior:
arkouda.apply.apply2. Strict Type Enforcement
The method explicitly requires:
pdarrayRejected cases:
This avoids silent materialization and ensures correctness while
applyonly supports numeric
pdarray.3. Dtype Handling
result_dtypeis required when the callable changes dtyperesult_dtypemust match the input dtype (validated via existing
apply.pyrules)4. Metadata Preservation
All tests confirm:
5. Testing
Added comprehensive tests covering:
Tests are gated behind the
ApplyMsgChapel module and skip cleanlywhen unsupported.
6. Test Stability Improvement
Clears cached attributes in
ak.applyduring connection setup toprevent stale state between tests.
Design Rationale
This implementation:
applysupport is limitedto numeric
pdarrayFuture extensions may expand support to:
This PR establishes the correct API contract and safety boundaries
first.
Example Usage
Impact
Related Work
Part of ongoing effort to:
Closes #5426: apply to Series accessor