Skip to content

BUG: Add min/max methods to ArrowExtensionArray GH#61311 #61924

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

skonda29
Copy link

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.

Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

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

Thanks for the pull request, but the proper fix is for _validate_key to handle key: ExtensionArray correctly

@skonda29
Copy link
Author

@mroeschke Thank you for your suggestion. I will rework on this PR to implement the _validate_key fix instead.

@simonjayhawkins simonjayhawkins added Bug Indexing Related to indexing on series/frames, not to indexes themselves Arrow pyarrow functionality labels Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arrow pyarrow functionality Bug Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: 'ArrowExtensionArray' object has no attribute 'max' when passing pyarrow-backed series to .iloc
3 participants