Repository navigation
Closes #5105: ArkoudaExtensionArray.__getitem__ - #5106
Conversation
4ed7c8b to
27a4bef
Compare
27a4bef to
78de756
Compare
7e7c2f3 to
8fabbbb
Compare
8fabbbb to
b50789d
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5106 +/- ##
========================================
Coverage ? 100.00%
========================================
Files ? 5
Lines ? 109
Branches ? 0
========================================
Hits ? 109
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:
|
b50789d to
a20ae1f
Compare
7d55305 to
1b171e0
Compare
drculhane
left a comment
There was a problem hiding this comment.
First observation.
There are test_getitem tests in both the TestArkoudaArrayExtension and TestArkoudaArrayGetitem classes.
Similarly, there are test_setitem tests in both the TestArkoudaArrayExtension and TestArkoudaArraySetitem classes.
This looks like the intent had been to put all the getitem tests into TestArkoudaArrayGetitem, and all the setitem tests into TestArkoudaArraySetitem. But maybe not?
drculhane
left a comment
There was a problem hiding this comment.
Second observation:
Here are the names of the setitem and getitem tests. There are a lot more for get than for set. I would expect these lists to be nearly identical.
test_setitem_scalar
test_setitem_array
test_setitem_with_python_sequence_value
test_setitem_with_arkoudaarray_value
test_setitem_with_pdarray_value
test_setitem_empty_list_noop
test_getitem_scalar
test_getitem_slice
test_getitem_scalar_returns_python_scalar
test_getitem_slice_returns_arkouda_array
test_getitem_numpy_int_array_indexer
test_getitem_numpy_bool_array_indexer
test_getitem_python_list_of_ints
test_getitem_python_list_of_bools
test_getitem_empty_list_returns_empty_array
test_getitem_arkouda_int_indexer
test_getitem_rejects_unsupported_list_element_type
test_getitem_numpy_unsigned_int_indexer
drculhane
left a comment
There was a problem hiding this comment.
One more stray comment:
It's not from this PR, but the file tests/pandas/extension/arkouda_array_extension.py has a commented out line of code on line 156. It might be worth eliminating that while we're here.
1b171e0 to
4395a44
Compare
6dd8e48 to
a7a3bbc
Compare
|
@drculhane I made the changes you requested. Would you please take another look? |
PR: Unified Indexing & Assignment for Arkouda Extension Arrays
This PR introduces a complete overhaul of
__getitem__and__setitem__across all Arkouda-backed pandas ExtensionArray types:ArkoudaArrayArkoudaStringArrayArkoudaCategoricalArrayThe goal is to bring these classes into full alignment with pandas/NumPy indexing rules, while ensuring all operations are executed entirely on the Arkouda server (no unintended materialization, no
to_numpy()orto_ndarray()inside assignment paths).Summary of Changes
⭐ 1. Unified Indexer Normalization
All extension arrays now normalize Python / NumPy indexers the same way:
int,slice: forwarded directly to the underlying Arkouda objectak.array(..., dtype=int64/uint64)ak.array(..., dtype=bool)ak.array(...)pdarrayindexers pass through unchanged[],np.array([], ...)) return an empty array of the same typeThis ensures consistency across array types and avoids breaking pandas’ internal indexing machinery.
⭐ 2. New
__getitem__ImplementationsArkoudaArrayArkoudaArrayfor everything else.ExtensionArray.__getitem__type signature.ArkoudaStringArrayobjectdtype arrays when round-tripped through NumPy.ArkoudaCategoricalArraystr_.Closes #5105: ArkoudaExtensionArray.getitem