BUG: IntervalIndex.putmask with datetimelike dtypes by jbrockmendel · Pull Request #37968 · pandas-dev/pandas (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation5 Commits18 Checks0 Files changed
Conversation
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
[ Show hidden characters]({{ revealButtonHref }})
- closes #xxxx
- tests added / passed
- passes
black pandas - passes
git diff upstream/master -u -- "*.py" | flake8 --diff - whatsnew entry
Implements NDArrayBackedExtensionArray.putmask which will hopefully be rolled into __array_function__ to simplify a bunch of code.
| res_values = self._data.copy() |
|---|
| try: |
| value = self._data._validate_setitem_value(value) |
| res_values.putmask(mask, value) |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self._data is defined as _data: ExtensionArray
Is ExtensionIndex only for ndarray backed ExtensionArray? or maybe will need catch AttributeError also eventually?
see also #35032 (comment) (sort of related).
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah my bad for not checking the code thoroughly before commenting and just looking at the diff.
I wasn't aware that you recently added a NDArrayBackedExtensionIndex.
Doesn't this add more complexity? what is the motivation for this?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this add more complexity? what is the motivation for this?
Its just taking methods that are duplicated in CategoricalIndex+DatetimeIndexOpsMixin and putting them in one place. I guess you could say that "adds complexity" bc there is an additional step in the inheritance chain?