BUG: Add min/max methods to ArrowExtensionArray GH#61311 #61924
+21
−0
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.
'ArrowExtensionArray' object has no attribute 'max'
when passing pyarrow-backed series to.iloc
#61311doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.The core problem is that when using .iloc with PyArrow-backed DataFrames, pandas' indexing validation calls min() and max() methods on the ArrowExtensionArray for bounds checking, but these methods were not implemented, resulting in AttributeError: 'ArrowExtensionArray' object has no attribute 'max'. This breaks basic indexing functionality that works with regular pandas DataFrames, creating an inconsistency in the PyArrow backend experience.
Proposed Solution -
My proposed solution addresses the issue by properly implementing min() and max() methods by utilizing the existing _reduce() infrastructure already present in the class. Included a test case in the file tests/arrays/test_array.file (detailed in the issue) to verify the implementation.