Repository navigation
Closes #5353: Fix Index.to_pandas string/object handling to use pandas "str" dtype when appropriate - #5354
Merged
ajpotts merged 2 commits intoJan 28, 2026
Conversation
ajpotts
force-pushed
the
5353_Fix_Index.to_pandas_string/object_handling_to_use_pandas_str
branch
6 times, most recently
from
January 27, 2026 20:50
08bcaf4 to
150232b
Compare
ajpotts
marked this pull request as ready for review
January 27, 2026 21:01
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5354 +/- ##
========================================
Coverage ? 100.00%
========================================
Files ? 5
Lines ? 115
Branches ? 0
========================================
Hits ? 115
Misses ? 0
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ajpotts
force-pushed
the
5353_Fix_Index.to_pandas_string/object_handling_to_use_pandas_str
branch
from
January 27, 2026 21:52
150232b to
0af53cf
Compare
… use pandas "str" dtype when appropriate
ajpotts
force-pushed
the
5353_Fix_Index.to_pandas_string/object_handling_to_use_pandas_str
branch
from
January 28, 2026 16:07
0af53cf to
49c024b
Compare
drculhane
approved these changes
Jan 28, 2026
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 refactors
Index.to_pandas()to better align Arkouda’s pandas interop with pandas’ own dtype semantics, while avoiding unintended dtype inference and unsupported server-side paths. It also modernizes and strengthens the associated unit tests.Key Changes
Index.to_pandas()behaviorExplicit dtype preservation for stable dtypes
Numeric, boolean, datetime, and timedelta data now round-trip to pandas with their original dtype explicitly preserved, avoiding pandas re-inference.
Improved string handling
stringdtype to match pandas NA semantics.Stringsobjects are materialized as pandas string dtype indexes.Categorical handling
CategoricalIndex, preserving categories, codes, and name.Categorical.to_pandas()already returns an Index, it is reused directly.Cleaner materialization path
Tests
test_to_pandaswith smaller, focused tests:Stringsallow_list=TrueDocs & cleanup
Index.to_pandas()docstring with clearer semantics and examples.Motivation
Previously,
to_pandas()always passeddtype=val.dtype, which could:This refactor makes dtype behavior explicit where it matters, defers to pandas where appropriate, and ensures tests match real Arkouda usage.
Backward Compatibility
Closes #5353: Fix Index.to_pandas string/object handling to use pandas "str" dtype when appropriate